Boruta core v0.2.0 Boruta.Oauth.Token View Source
Token schema. Representing both access tokens and codes.
Link to this section Summary
Link to this section Types
Link to this type
t()
View Sourcet() :: %Boruta.Oauth.Token{
client: Boruta.Oauth.Client.t(),
expires_at: integer(),
id: term(),
inserted_at: DateTime.t(),
redirect_uri: String.t(),
refresh_token: String.t(),
resource_owner: struct(),
revoked_at: DateTime.t(),
scope: String.t(),
state: String.t(),
type: String.t(),
value: String.t()
}
Link to this section Functions
Determines if a token is expired
Examples
iex> expired?(%Boruta.Oauth.Token{expires_at: 1638316800}) # 1st january 2021
:ok
iex> expired?(%Boruta.Oauth.Token{expires_at: 0}) # 1st january 1970
{:error, "Token expired."}