class Devise::Strategies::Rememberable

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/devise/strategies/rememberable.rbs

class Devise::Strategies::Rememberable < Devise::Strategies::Authenticatable
  def remember_key: () -> untyped
  def valid?: () -> untyped
end

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!

strategy handle the authentication.
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)
  unless resource
    cookies.delete(remember_key)
    return pass
  end
  if validate(resource)
    remember_me(resource) if extend_remember_me?(resource)
    resource.after_remembered
    success!(resource)
  end
end

def clean_up_csrf?

tokens expired.
we would render a page on first access with all csrf
rememberable is triggered on GET requests which means
In fact, cleaning it up here would be a bug because
No need to clean up the CSRF when using rememberable.
def clean_up_csrf?
  false
end

def extend_remember_me?(resource)

def extend_remember_me?(resource)
  resource.respond_to?(:extend_remember_period) && resource.extend_remember_period
end

def remember_cookie

def remember_cookie
  @remember_cookie ||= cookies.signed[remember_key]
end

def remember_key

Experimental RBS support (using type sampling data from the type_fusion project).

def remember_key: () -> untyped

This signature was generated using 2 samples from 1 application.

def remember_key
  mapping.to.rememberable_options.fetch(:key, "remember_#{scope}_token")
end

def remember_me?

def remember_me?
  true
end

def valid?

Experimental RBS support (using type sampling data from the type_fusion project).

def valid?: () -> untyped

This signature was generated using 1 sample from 1 application.

A valid strategy for rememberable needs a remember token in the cookies.
def valid?
  @remember_cookie = nil
  remember_cookie.present?
end