gmail v0.1.3 Gmail.OAuth2

OAuth2 access token handling.

Summary

Functions

Checks if an access token has expired

Gets the config for a Gmail API connection, including a refreshed access token

Functions

access_token_expired?(map)

Specs

access_token_expired?(map) :: boolean

Checks if an access token has expired.

Examples

iex> Gmail.OAuth2.access_token_expired?(%{expires_at: 1})
true

iex> Gmail.OAuth2.access_token_expired?(%{expires_at: (Timex.Date.to_secs(Timex.Date.now) + 10)})
false
get_config()

Specs

get_config :: map

Gets the config for a Gmail API connection, including a refreshed access token.

refresh_access_token(refresh_token)

Specs

refresh_access_token(String.t) :: {String.t, number}