0
0
Fork 0

Add direct link to the Single-Sign On provider if there is only one sign up method available (#26083)

This commit is contained in:
CSDUMMI 2023-08-03 16:43:15 +02:00 committed by GitHub
parent a5768d3ea6
commit 120f5802c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 82 additions and 33 deletions

View file

@ -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