mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 21:17:48 +08:00
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:
parent
750a3ce5e5
commit
7056db26e6
|
@ -11,8 +11,16 @@ class SessionController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def sso
|
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
|
if SiteSetting.enable_sso
|
||||||
redirect_to DiscourseSingleSignOn.generate_url(params[:return_path] || path('/'))
|
redirect_to DiscourseSingleSignOn.generate_url(return_path)
|
||||||
else
|
else
|
||||||
render nothing: true, status: 404
|
render nothing: true, status: 404
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user