about summary refs log tree commit diff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-06-01 19:22:55 +0200
committerGitHub <noreply@github.com>2022-06-01 19:22:55 +0200
commitae4f068a845d710c2e60ecf8b49144892505e773 (patch)
tree769c092a98d5c5550f1a1c92946c7ecd2bf2f7aa /app/helpers/application_helper.rb
parent84266f87e7f3ecc0f6b4aa35d18a2a5dccb47cd4 (diff)
Fix CAS_DISPLAY_NAME, SAML_DISPLAY_NAME and OIDC_DISPLAY_NAME being ignored (#18568)
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index bba7070d0..705cc2e3f 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -83,7 +83,8 @@ module ApplicationHelper
   end
 
   def provider_sign_in_link(provider)
-    link_to I18n.t("auth.providers.#{provider}", default: provider.to_s.chomp('_oauth2').capitalize), omniauth_authorize_path(:user, provider), class: "button button-#{provider}", method: :post
+    label = Devise.omniauth_configs[provider]&.strategy&.display_name.presence || I18n.t("auth.providers.#{provider}", default: provider.to_s.chomp('_oauth2').capitalize)
+    link_to label, omniauth_authorize_path(:user, provider), class: "button button-#{provider}", method: :post
   end
 
   def open_deletion?