omodules

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const OauthGoogleUrlAPI = "https://www.googleapis.com/oauth2/v2/userinfo?access_token="

Variables

View Source
var CONFIG_JSON = GetConfig()
View Source
var GoogleOauthConfig = &oauth2.Config{
	RedirectURL:  "http://localhost:1337/oauth2/google/callback",
	ClientID:     CONFIG_JSON["GOOGLE_OAUTH_CLIENT_ID"],
	ClientSecret: CONFIG_JSON["GOOGLE_OAUTH_CLIENT_SECRET"],
	Scopes:       []string{"https://www.googleapis.com/auth/userinfo.email"},
	Endpoint:     google.Endpoint,
}

Functions

func GenerateStateOauthCookie

func GenerateStateOauthCookie(c *gin.Context) string

func GetUserDataFromGoogle

func GetUserDataFromGoogle(code string) ([]byte, error)

Types

type ConfigJSON

type ConfigJSON map[string]string

func GetConfig

func GetConfig() ConfigJSON

type OAuthStruct

type OAuthStruct struct {
	ID             string `json:"id"`
	EMAIL          string `json:"email"`
	VERIFIED_EMAIL bool   `json:"verified_email"`
	PICTURE        string `json:"picture"`
}

Jump to

Keyboard shortcuts

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