mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Cleaned up the sso codefix, thanks @SamSaffron
@SamSaffron showed me a cleaner way to use the if statements in the sso redirect code. Thanks sam ;)
This commit is contained in:
parent
334a357363
commit
96e6fd3449
1 changed files with 6 additions and 4 deletions
|
@ -391,10 +391,12 @@ class ApplicationController < ActionController::Base
|
|||
cookies[:destination_url] = request.original_url unless request.original_url =~ /uploads/
|
||||
|
||||
# redirect user to the SSO page if we need to log in AND SSO is enabled
|
||||
if (SiteSetting.enable_sso && SiteSetting.login_required)
|
||||
redirect_to '/session/sso'
|
||||
elsif SiteSetting.login_required?
|
||||
redirect_to :login
|
||||
if SiteSetting.login_required?
|
||||
if SiteSetting.enable_sso?
|
||||
redirect_to '/session/sso'
|
||||
else
|
||||
redirect_to :login
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue