Skip to content

Commit

Permalink
Untangled the logic in Devise::Strategies::TokenAuthenticatable#param…
Browse files Browse the repository at this point in the history
…s_auth_hash
  • Loading branch information
mathieuravaux committed Jul 25, 2011
1 parent a2700bc commit 4d91fb4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/devise/strategies/token_authenticatable.rb
Expand Up @@ -39,9 +39,11 @@ def remember_me?

# Try both scoped and non scoped keys.
def params_auth_hash
token_authentication_key = authentication_keys.first
return params if params[scope].kind_of?(Hash) && !params[scope].has_key?(token_authentication_key) && params.has_key?(token_authentication_key)
params[scope] || params
if params[scope].kind_of?(Hash) && params[scope].has_key?(authentication_keys.first)
params[scope]
else
params
end
end

# Overwrite authentication keys to use token_authentication_key.
Expand Down

0 comments on commit 4d91fb4

Please sign in to comment.