helpers

package
v0.0.0-...-86131fc Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 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 GenerateAllTokens

func GenerateAllTokens(email string, firstName string, lastName string, uid string) (signedToken string, signedRefreshtoken string, err error)

GenerateAllTokens generates both the detailed token and refresh token

func UpdateAllTokens

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

UpdateAllTokens renews the user tokens when they login

Types

type SignedDetails

type SignedDetails struct {
	Email      string
	First_name string
	Last_name  string
	Uid        string
	jwt.StandardClaims
}

SignedDetails

func ValidateToken

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

ValidateToken validates the jwt token

Jump to

Keyboard shortcuts

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