util

package
v0.0.0-...-0eea77f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SECRET_KEY string = os.Getenv("SECRET_KEY")

Functions

func CheckUserType

func CheckUserType(ctx *gin.Context, role string) error

func GenerateAllTokens

func GenerateAllTokens(email string, firstName string, lastName string, userType string, userId string) (signedToken string, signedRefreshToken string, err error)

func MatchUserTypeToUid

func MatchUserTypeToUid(ctx *gin.Context, userId string) error

func UpdateAllTokens

func UpdateAllTokens(signedToken string, signedRefreshToken string, userId string)

Types

type SignedDetails

type SignedDetails struct {
	Email     string
	FirstName string
	LastName  string
	UserId    string
	UserType  string
	jwt.StandardClaims
}

func ValidateToken

func ValidateToken(signedToken string) (claims *SignedDetails, msg string)

Jump to

Keyboard shortcuts

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