controllers

package
v0.0.0-...-3c06be6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 14 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 = GenerateGoogleOauthConfig()

Functions

func GenerateGoogleOauthConfig

func GenerateGoogleOauthConfig() *oauth2.Config

func GenerateStateOauthCookie

func GenerateStateOauthCookie(c *gin.Context) string

func GetUserDataFromGoogle

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

func Index

func Index(c *gin.Context)

func RegisterGoogleOauth

func RegisterGoogleOauth(c *gin.Context)

func RunGoogleOauth

func RunGoogleOauth(c *gin.Context)

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