Documentation ¶
Index ¶
- func Authenticate(token *oauth2.Token, credentials models.Credentials, db models.DB) (string, int, error)
- func GenerateLoginURL(oauthState string, credentials models.Credentials) (string, error)
- func GetAccessToken(code string) (*oauth2.Token, error)
- func SaveToken(token *oauth2.Token, email, keyAccessToken string, db models.DB) error
- func Token(accessToken string, db models.DB) (*oauth2.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶ added in v0.2.0
func Authenticate( token *oauth2.Token, credentials models.Credentials, db models.DB, ) (string, int, error)
Authenticate authenticates an access token or gets a new one with the refresh token The returned string is either the error message or the user email
func GenerateLoginURL ¶
func GenerateLoginURL(oauthState string, credentials models.Credentials) (string, error)
GenerateLoginURL generates the login url using googleapis OAuth2 Client Secret and OAuth2 Client ID
func GetAccessToken ¶
GetAccessToken exchange authorization code with access token
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.