Class: Keycard::Authentication::AuthToken
- Defined in:
- lib/keycard/authentication/auth_token.rb
Overview
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.
Instance Method Summary collapse
Methods inherited from Method
bind, bind_class_method, #initialize
Constructor Details
This class inherits a constructor from Keycard::Authentication::Method
Instance Method Details
#apply ⇒ Object
11 12 13 14 15 16 17 18 19 |
# 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 |