Model Integration
Last updated
Last updated
Typical use of this gem will not require the use of any of the following model methods. All authentication should be handled invisibly by the .
Models that include the DeviseTokenAuth::Concerns::User
concern will have access to the following public methods (read the above section for context on token
and client
):
valid_token?
: check if an authentication token is valid. Accepts a token
and client
as arguments. Returns a boolean.
Example:
create_new_auth_token
: creates a new auth token with all of the necessary metadata. Accepts client
as an optional argument. Will generate a new client
if none is provided. Returns the authentication headers that should be sent by the client as an object.
Example:
build_auth_headers
: generates the auth header that should be sent to the client with the next request. Accepts token
and client
as arguments. Returns a string.
Example: