summaryrefslogtreecommitdiff
path: root/users/lib
diff options
context:
space:
mode:
Diffstat (limited to 'users/lib')
-rw-r--r--users/lib/warden/strategies/secure_remote_password.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/users/lib/warden/strategies/secure_remote_password.rb b/users/lib/warden/strategies/secure_remote_password.rb
index 5032914..f1b1a57 100644
--- a/users/lib/warden/strategies/secure_remote_password.rb
+++ b/users/lib/warden/strategies/secure_remote_password.rb
@@ -25,14 +25,17 @@ module Warden
end
def validate!
- client = session[:handshake].authenticate(params['client_auth'].hex)
- if client
+ if client = validate
success!(User.find_by_login(client.username))
else
fail!({:login => "invalid_user_pass", :password => "invalid_user_pass"})
end
end
+ def validate
+ session[:handshake].authenticate(params['client_auth'].hex)
+ end
+
def initialize!
if user = User.find_by_login(id)
client = SRP::Client.new user.username,