WardrikOAuth. Token
(wardrik_oauth v0.1.0-rc.1)
Copy Markdown
A token an authorization server granted. Kept in the vault as JSON.
Summary
Functions
Copies old's refresh token into new if new has none.
Decodes a token from JSON.
Encodes the token as JSON.
Marks the token expired, so the next use refreshes it.
Returns whether the token is valid for more than 30 more seconds.
Reads a token endpoint's response. Returns the token, or the error it holds.
Returns whether the token can be refreshed.
Types
Functions
Copies old's refresh token into new if new has none.
Decodes a token from JSON.
Encodes the token as JSON.
Marks the token expired, so the next use refreshes it.
Returns whether the token is valid for more than 30 more seconds.
@spec from_response(pos_integer(), map(), String.t()) :: {:ok, t()} | {:error, term()}
Reads a token endpoint's response. Returns the token, or the error it holds.
Returns whether the token can be refreshed.