Respect cookie[:destination_url] in Single Sign On

When the login_required setting is true, the destination URL is dropped. This change means it will be
respected at login time
This commit is contained in:
Dan Singerman 2015-06-02 12:29:27 +01:00
parent 750a3ce5e5
commit 7056db26e6
1 changed files with 9 additions and 1 deletions

View File

@ -11,8 +11,16 @@ class SessionController < ApplicationController
end
def sso
if params[:return_path]
return_path = params[:return_path]
elsif cookies[:destination_url]
return_path = URI::parse(cookies[:destination_url]).path
else
return_path = path('/')
end
if SiteSetting.enable_sso
redirect_to DiscourseSingleSignOn.generate_url(params[:return_path] || path('/'))
redirect_to DiscourseSingleSignOn.generate_url(return_path)
else
render nothing: true, status: 404
end