Method: Devise::Strategies::Rememberable#authenticate!

Defined in:
lib/devise/strategies/rememberable.rb

#authenticate!Object

To authenticate a user we deserialize the cookie and attempt finding the record in the database. If the attempt fails, we pass to another strategy handle the authentication.



18
19
20
21
22
23
24
25
26
27
# File 'lib/devise/strategies/rememberable.rb', line 18

def authenticate!
  resource = mapping.to.serialize_from_cookie(*remember_cookie)

  if validate(resource)
    success!(resource)
  else
    cookies.delete(remember_key)
    pass
  end
end