diff options
Diffstat (limited to 'users/lib')
-rw-r--r-- | users/lib/warden/strategies/secure_remote_password.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/users/lib/warden/strategies/secure_remote_password.rb b/users/lib/warden/strategies/secure_remote_password.rb index 483336d..363e6a0 100644 --- a/users/lib/warden/strategies/secure_remote_password.rb +++ b/users/lib/warden/strategies/secure_remote_password.rb @@ -25,10 +25,15 @@ module Warden end def validate! - client = session[:handshake].authenticate(params['client_auth'].hex) - client ? - success!(User.find_by_login(client.username)) : + if client = validate + success!(User.find_by_login(client.username)) + else fail!(:password => "wrong_password") + end + end + + def validate + session[:handshake].authenticate(params['client_auth'].hex) end def initialize! |