diff options
author | Azul <azul@leap.se> | 2012-11-26 12:16:53 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-26 12:16:53 +0100 |
commit | 1ea7da1314a46a87512e4f3d7f99249883f4f12f (patch) | |
tree | ab07f2e702b5f5eee9638ef751669f88298faad2 /users/lib/warden | |
parent | 716dc248e940be8bd323a9d92f98785737fc99a0 (diff) | |
parent | cdda8f095d49cdda94c3527ecb92cb15c300327b (diff) |
Merge branch 'feature/users-change-passwords' into develop
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 95570e0..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_param(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) |