pkg

package
v1.0.0-feature-modules... Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAuthorizationCode = fmt.Errorf("invalid authorization code")
	ErrInvalidIDToken           = fmt.Errorf("invalid ID token")
)

Functions

This section is empty.

Types

type GoogleSignin

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

func NewGoogleSignin

func NewGoogleSignin(
	clientID string,
	clientSecret string,
	redirectURL string,
	scopes []string,
) *GoogleSignin

func (*GoogleSignin) Exchange

func (g *GoogleSignin) Exchange(ctx context.Context, code string) (*GoogleUser, error)

func (*GoogleSignin) GetAuthURL

func (g *GoogleSignin) GetAuthURL(state string) string

func (*GoogleSignin) VerifyGoogleIDToken

func (g *GoogleSignin) VerifyGoogleIDToken(
	ctx context.Context,
	tokenString string,
) (*GoogleUser, error)

type GoogleUser

type GoogleUser struct {
	ID         string `json:"id"`
	Email      string `json:"email"`
	Verified   bool   `json:"verified_email"`
	Name       string `json:"name"`
	GivenName  string `json:"given_name"`
	FamilyName string `json:"family_name"`
	Picture    string `json:"picture"`
	Locale     string `json:"locale"`
}

Jump to

Keyboard shortcuts

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