diff options
author | Azul <azul@leap.se> | 2012-11-22 16:22:49 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-22 16:22:49 +0100 |
commit | fb791b200ee4da1b6a2f4e3121cb26196e28c953 (patch) | |
tree | d71fa9065faec5f1bb584e18e45583b393bcd429 /users/app/controllers/controller_extension | |
parent | 13f53593551549d8e95e382fd42a92efc170943d (diff) | |
parent | ec87ccfa185a4c063386d385de7af15f993b77d8 (diff) |
Merge branch 'feature/error-messages-on-login' into develop
Diffstat (limited to 'users/app/controllers/controller_extension')
-rw-r--r-- | users/app/controllers/controller_extension/authentication.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/users/app/controllers/controller_extension/authentication.rb b/users/app/controllers/controller_extension/authentication.rb index 87f7921..6ac7a5b 100644 --- a/users/app/controllers/controller_extension/authentication.rb +++ b/users/app/controllers/controller_extension/authentication.rb @@ -7,8 +7,12 @@ module ControllerExtension::Authentication helper_method :current_user, :logged_in?, :admin? end - def authentication_error - warden.winning_strategy.try(:message) + def authentication_errors + return unless errors = warden.winning_strategy.try(:message) + errors.inject({}) do |translated,err| + translated[err.first] = I18n.t(err.last) + translated + end end def logged_in? |