class Keycard::Authentication::AuthToken

Identity verification based on an authorization token.

The bound finder method is expected to take one parameter, the token as presented by the user. This will typically need to be digested for comparison with a stored version.

Public Instance Methods

apply() click to toggle source
# File lib/keycard/authentication/auth_token.rb, line 11
def apply
  if token.nil?
    skipped("No auth_token found in request attributes")
  elsif (account = finder.call(token))
    succeeded(account, "Account found for supplied Authorization Token", csrf_safe: true)
  else
    failed("Account not found for supplied Authorization Token")
  end
end

Private Instance Methods

token() click to toggle source
# File lib/keycard/authentication/auth_token.rb, line 23
def token
  attributes.auth_token
end