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.



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

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

  unless resource
    cookies.delete(remember_key)
    return pass
  end

  if validate(resource)
    success!(resource)
  end
end