diff options
author | Azul <azul@leap.se> | 2012-11-26 12:15:54 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-26 12:15:54 +0100 |
commit | cdda8f095d49cdda94c3527ecb92cb15c300327b (patch) | |
tree | ab07f2e702b5f5eee9638ef751669f88298faad2 /users/lib/warden | |
parent | 595518684b9c4364f96c97a84cc481b5ae0da981 (diff) |
fixed login error message on wrong username
Diffstat (limited to 'users/lib/warden')
-rw-r--r-- | users/lib/warden/strategies/secure_remote_password.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/users/lib/warden/strategies/secure_remote_password.rb b/users/lib/warden/strategies/secure_remote_password.rb index 953e2e9..594e27e 100644 --- a/users/lib/warden/strategies/secure_remote_password.rb +++ b/users/lib/warden/strategies/secure_remote_password.rb @@ -30,11 +30,12 @@ module Warden end def initialize! - user = User.find_by_login(id) - session[:handshake] = user.initialize_auth(params['A'].hex) - custom! json_response(session[:handshake]) - rescue RECORD_NOT_FOUND - fail! :login => "user_not_found" + if user = User.find_by_login(id) + session[:handshake] = user.initialize_auth(params['A'].hex) + custom! json_response(session[:handshake]) + else + fail! :login => "user_not_found" + end end def json_response(object) |