about summary refs log tree commit diff
path: root/app/controllers/auth
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-11-07 21:07:01 +0100
committerGitHub <noreply@github.com>2022-11-07 21:07:01 +0100
commitac219dd1f6d660d3728c5881c4eb3b672fea432e (patch)
treefd2f30f2cb28a964442cc7b10d8ad8729bd659d2 /app/controllers/auth
parentc493c967d67058a305006a09de66a1e08d877680 (diff)
parent2bc22be66cf09ed19eb7fb23b08324882a73b2b9 (diff)
Merge pull request #1903 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/auth')
-rw-r--r--app/controllers/auth/omniauth_callbacks_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/auth/omniauth_callbacks_controller.rb b/app/controllers/auth/omniauth_callbacks_controller.rb
index f9cf6d655..3d7962de5 100644
--- a/app/controllers/auth/omniauth_callbacks_controller.rb
+++ b/app/controllers/auth/omniauth_callbacks_controller.rb
@@ -18,7 +18,8 @@ class Auth::OmniauthCallbacksController < Devise::OmniauthCallbacksController
         )
 
         sign_in_and_redirect @user, event: :authentication
-        set_flash_message(:notice, :success, kind: Devise.omniauth_configs[provider].strategy.display_name.capitalize) if is_navigational_format?
+        label = Devise.omniauth_configs[provider]&.strategy&.display_name.presence || I18n.t("auth.providers.#{provider}", default: provider.to_s.chomp('_oauth2').capitalize)
+        set_flash_message(:notice, :success, kind: label) if is_navigational_format?
       else
         session["devise.#{provider}_data"] = request.env['omniauth.auth']
         redirect_to new_user_registration_url