Class: Strategies::TokenAuthenticatable

Inherits:
Object
  • Object
show all
Defined in:
lib/devise/devise_custom_token.rb

Instance Method Summary collapse

Instance Method Details

#authenticate!Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/devise/devise_custom_token.rb', line 9

def authenticate!
  auth=valid_password? ? authentication_hash.merge({authentication_keys.first=>self.password}) : authentication_hash
  resource = mapping.to.find_for_token_authentication(auth)
  if validate(resource)
    resource.after_token_authentication
    success!(resource)
  else
    fail(:invalid_token)
  end
end