class Devise::Strategies::Rememberable
authenticatable.
recreate the user from this cookie if it exists. Must be called before
to verify whether there is a cookie with the remember token, and to
Remember the user through the remember token. This strategy is responsible
def authenticate!
the record in the database. If the attempt fails, we pass to another
To authenticate a user we deserialize the cookie and attempt finding
def authenticate! resource = mapping.to.serialize_from_cookie(*remember_cookie) if validate(resource) success!(resource) elsif !halted? cookies.delete(remember_key) pass end end
def decorate(resource)
def decorate(resource) super resource.extend_remember_period = mapping.to.extend_remember_period if resource.respond_to?(:extend_remember_period=) end
def remember_cookie
def remember_cookie @remember_cookie ||= cookies.signed[remember_key] end
def remember_key
def remember_key "remember_#{scope}_token" end
def remember_me?
def remember_me? true end
def valid?
def valid? @remember_cookie = nil remember_cookie.present? end