Add direct link to the Single-Sign On provider if there is only one sign up method available (#26083)
This commit is contained in:
parent
a5768d3ea6
commit
120f5802c0
8 changed files with 82 additions and 33 deletions
|
@ -32,6 +32,7 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||
single_user_mode: Rails.configuration.x.single_user_mode,
|
||||
trends_as_landing_page: Setting.trends_as_landing_page,
|
||||
status_page_url: Setting.status_page_url,
|
||||
sso_redirect: sso_redirect,
|
||||
}
|
||||
|
||||
if object.current_account
|
||||
|
@ -108,4 +109,8 @@ class InitialStateSerializer < ActiveModel::Serializer
|
|||
def instance_presenter
|
||||
@instance_presenter ||= InstancePresenter.new
|
||||
end
|
||||
|
||||
def sso_redirect
|
||||
"/auth/auth/#{Devise.omniauth_providers[0]}" if ENV['OMNIAUTH_ONLY'] == 'true' && Devise.omniauth_providers.length == 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue