mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 14:49:07 +08:00
FIX: Forward to SSO login automatically
Forward to SSO login URL automatically if SSO is enabled and login is required. Makes it simpler for users to log in automatically.
This commit is contained in:
parent
ca5730018a
commit
334a357363
|
@ -389,7 +389,13 @@ 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.enable_sso && SiteSetting.login_required)
|
||||
redirect_to '/session/sso'
|
||||
elsif SiteSetting.login_required?
|
||||
redirect_to :login
|
||||
end
|
||||
end
|
||||
|
||||
def block_if_readonly_mode
|
||||
|
|
Loading…
Reference in New Issue
Block a user