IntegrateWeb.Auth (IntegrateDB v0.1.0) View Source
Token based authentication logic using Phoenix.Token.
Link to this section Summary
Functions
Fetch user from the conn if there's a valid bearer token in the authorization header.
Generate auth tokens for a given user_id.
Verify a given candidate refresh_token.
Verify a given candidate token.
Link to this section Functions
Fetch user from the conn if there's a valid bearer token in the authorization header.
Returns %User{} or nil.
Generate auth tokens for a given user_id.
Returns {token, refresh_token}.
Verify a given candidate refresh_token.
Returns {:ok, user_id} if valid, otherwise nil.
Verify a given candidate token.
Returns {:ok, user_id} if valid, otherwise nil.