summaryrefslogtreecommitdiff
path: root/users/lib
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-11-26 12:16:53 +0100
committerAzul <azul@leap.se>2012-11-26 12:16:53 +0100
commit1ea7da1314a46a87512e4f3d7f99249883f4f12f (patch)
treeab07f2e702b5f5eee9638ef751669f88298faad2 /users/lib
parent716dc248e940be8bd323a9d92f98785737fc99a0 (diff)
parentcdda8f095d49cdda94c3527ecb92cb15c300327b (diff)
Merge branch 'feature/users-change-passwords' into develop
Diffstat (limited to 'users/lib')
-rw-r--r--users/lib/warden/strategies/secure_remote_password.rb11
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)