From: Tom Hughes Date: Tue, 23 Nov 2021 17:01:06 +0000 (+0000) Subject: Handle authentication failure callbacks with no message X-Git-Tag: live~1442 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/31e638474a5a3520b0fb04d38e6d4d98db8b9054?ds=sidebyside Handle authentication failure callbacks with no message --- diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 38a61208c..8b04167b0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 7a2aba1aa..caee480d9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: |