oauth

package
v0.0.0-...-eabb412 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGmailService

func GetGmailService(token, refreshToken string, expiry time.Time) *gmail.Service

GetGmailService will return a gmail service.

func RetrieveTokensFromSession

func RetrieveTokensFromSession(
	r *http.Request,
	randomID string,
) (string, string, time.Time, error)

RetrieveTokensFromSession returns a token stored in the session

Types

type Claims

type Claims struct {
	RandomID string
	jwt.StandardClaims
}

Claims struct to be encoded to a JWT.

func DecodeJwtToken

func DecodeJwtToken(tokenString string) (*Claims, error)

DecodeJwtToken Parse the JWT string and store the result in claims.

type Oauth

type Oauth struct {
	// contains filtered or unexported fields
}

func (*Oauth) GoogleCallback

func (oauth *Oauth) GoogleCallback(w http.ResponseWriter, r *http.Request)

func (*Oauth) GoogleLogin

func (oauth *Oauth) GoogleLogin(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL