utils

package
v0.0.0-...-acefb17 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExchangeFacebookCodeForToken

func ExchangeFacebookCodeForToken(clientID, clientSecret, code, redirectURL string) (string, string, error)

func ExtractGoogleData

func ExtractGoogleData(clientID, clientSecret, code, redirectURL string) (string, []byte, error)

func GenerateJWTToken

func GenerateJWTToken(tokenType TokenType, id primitive.ObjectID, secretKey string) (string, error)

func GenerateToken

func GenerateToken() (string, error)

func HashPassword

func HashPassword(password string) (string, error)

func ValidateJWTToken

func ValidateJWTToken(expectedTokenType TokenType, signedToken, secretKey string) (primitive.ObjectID, error)

func VerifyPassword

func VerifyPassword(hashedPassword, password string) bool

Types

type TokenType

type TokenType string
const (
	AccessToken  TokenType = "access_token"
	RefreshToken TokenType = "refresh_token"
	ResetToken   TokenType = "reset_token"
)

Jump to

Keyboard shortcuts

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