]> git.openstreetmap.org Git - rails.git/commitdiff
Handle authentication failure callbacks with no message
authorTom Hughes <tom@compton.nu>
Tue, 23 Nov 2021 17:01:06 +0000 (17:01 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 23 Nov 2021 17:01:06 +0000 (17:01 +0000)
app/controllers/users_controller.rb
config/locales/en.yml

index 38a61208c4635120ea9864a65dfd360728914baa..8b04167b0325191ea5fa860b2b30043ed6cf435e 100644 (file)
@@ -335,7 +335,7 @@ class UsersController < ApplicationController
   ##
   # omniauth failure callback
   def auth_failure
-    flash[:error] = t("users.auth_failure.#{params[:message]}")
+    flash[:error] = t(params[:message], :scope => "users.auth_failure", :default => t("users.auth_failure.unknown_error"))
     redirect_to params[:origin] || login_url
   end
 
index 7a2aba1aa055e0da4352a3e6c2145ac56969eb67..caee480d9448425f5a0b38aa01e916a7e4ad7bf5 100644 (file)
@@ -2623,6 +2623,7 @@ en:
       no_authorization_code: No authorization code
       unknown_signature_algorithm: Unknown signature algorithm
       invalid_scope: Invalid scope
+      unknown_error: Authentication failed
     auth_association:
       heading: Your ID is not associated with a OpenStreetMap account yet.
       option_1: |