summaryrefslogtreecommitdiff
path: root/users/lib/warden
diff options
context:
space:
mode:
Diffstat (limited to 'users/lib/warden')
-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 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)