Skip to content

Instantly share code, notes, and snippets.

@zoltanarvai
Created March 23, 2019 11:05
Show Gist options
  • Save zoltanarvai/883ae1f9f5f435e0391557135e11bb72 to your computer and use it in GitHub Desktop.
Save zoltanarvai/883ae1f9f5f435e0391557135e11bb72 to your computer and use it in GitHub Desktop.
Struct to encompass token and other meta info
defmodule Auth.TokenResult do
@moduledoc """
This struct represents the result of the authentication sign-in process.
We get a JWT access token from Auth0 and an expires_in field explaining
how long the token field will be available
"""
@enforce_keys [:access_token, :expires_in]
defstruct access_token: "", expires_in: 0
@type t :: %__MODULE__{
access_token: String.t(),
expires_in: String.t()
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment