Model Integration
DeviseTokenAuth::Concerns::User
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 controller concerns.
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 atoken
andclient
as arguments. Returns a boolean.Example:
create_new_auth_token
: creates a new auth token with all of the necessary metadata. Acceptsclient
as an optional argument. Will generate a newclient
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. Acceptstoken
andclient
as arguments. Returns a string.Example:
Last updated