mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Merge pull request #3227 from sigginet/patch-1
FIX: Forward to SSO login automatically
This commit is contained in:
commit
0ccce7a59b
1 changed files with 9 additions and 1 deletions
|
@ -389,7 +389,15 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
# save original URL in a cookie
|
||||
cookies[:destination_url] = request.original_url unless request.original_url =~ /uploads/
|
||||
redirect_to :login if SiteSetting.login_required?
|
||||
|
||||
# redirect user to the SSO page if we need to log in AND SSO is enabled
|
||||
if SiteSetting.login_required?
|
||||
if SiteSetting.enable_sso?
|
||||
redirect_to '/session/sso'
|
||||
else
|
||||
redirect_to :login
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def block_if_readonly_mode
|
||||
|
|
Loading…
Reference in a new issue