Authex v0.3.0 Authex.Token View Source
A struct wrapper for token claims.
Typically, we shouldnt need to directly interact with this module. Rather, we
should use the Authex.token/2
callback defined in our auth module.
Link to this section Summary
Functions
Creates a new Authex.Token
struct from the given claims and options
Link to this section Types
Link to this type
claim() View Source
Link to this type
claims()
View Source
claims()
View Source
claims() :: [claim()]
claims() :: [claim()]
Link to this type
compact()
View Source
compact()
View Source
compact() :: binary()
compact() :: binary()
Link to this type
option() View Source
Link to this type
options()
View Source
options()
View Source
options() :: [option()]
options() :: [option()]
Link to this section Functions
Link to this function
new(auth, claims \\ [], opts \\ []) View Source
Creates a new Authex.Token
struct from the given claims and options.
Options
:time
- the base time (timestamp format) in which to use.:ttl
- the TTL for the token.
Examples
Authex.Token.new(MyApp.Auth, [sub: 1], [ttl: 60])