summaryrefslogtreecommitdiff
path: root/users/app/controllers/controller_extension
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-11-26 10:15:22 -0800
committerjessib <jessib@leap.se>2012-11-26 10:15:22 -0800
commit3e744e4e226eae3ea2f900d9fccc32b6c046d65f (patch)
tree1b19232d08229b178c094c92e2242ce1686099ae /users/app/controllers/controller_extension
parentd9d67bd60d3fdfa4106977de9e5aba11f659fc79 (diff)
parentbf74255d1530fe5852dc6e6c27ef975ce9aa8d3c (diff)
Merge branch 'develop' into help_develop
Conflicts: users/app/views/sessions/_nav.html.haml
Diffstat (limited to 'users/app/controllers/controller_extension')
-rw-r--r--users/app/controllers/controller_extension/authentication.rb8
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 1726278..f2184d9 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?