helpers

package
v0.0.0-...-f94c27c Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: GPL-3.0 Imports: 13 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) (err error)

func GenerateTokens

func GenerateTokens(
	email string, firstName string, lastName string, userType string, uid string) (
	accessToken string, refreshToken string, err error)

func MatchUserTypeToUId

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

func UpdateTokens

func UpdateTokens(accessToken string, refreshToken string, userId string)

Types

type SignedDetails

type SignedDetails struct {
	Email     string
	FirstName string
	LastName  string
	Uid       string
	UserType  string
	jwt.RegisteredClaims
}

func ValidateToken

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

Jump to

Keyboard shortcuts

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