summaryrefslogtreecommitdiff
path: root/users/lib/warden/strategies
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2013-03-01 03:50:26 -0800
committerazul <azul@riseup.net>2013-03-01 03:50:26 -0800
commita91b77e5b60bb467c2e12fec8bd04d028896ae53 (patch)
tree9f25940168c0c2312eabfcf245c8d71172bd2ba5 /users/lib/warden/strategies
parent2eaa2238224408532b5e4eb41662e6dece7ac390 (diff)
parent4a92bab4d8c231a17a14afc81c391f9a1f91c063 (diff)
Merge pull request #32 from azul/feature/api-version-1-fixes
Feature: API version 1 fixes
Diffstat (limited to 'users/lib/warden/strategies')
-rw-r--r--users/lib/warden/strategies/secure_remote_password.rb11
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!