View Source OTT (ott v0.1.0)

Documentation for OTT.

Summary

Functions

Access the token data.

Generates a one-time token for the specified data.

Functions

Link to this function

access_token_data(token)

View Source
@spec access_token_data(binary()) :: map() | nil

Access the token data.

Returns the data associated with the token only if the token has not been used and has not been revoked. Otherwise, it returns nil.

Link to this function

generate_token!(data, opts \\ [])

View Source
@spec generate_token!(
  map(),
  keyword()
) :: binary()

Generates a one-time token for the specified data.

Options

  • :expires_in_minutes - the duration of validity for the token in minutes. Defaults to 5 minutes.
  • :token_length - the length of the generated token. Defaults to 10 chars.