helpers

package
v0.0.0-...-d7a48c5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SECRET_KEY string = config.SecretKey

Functions

func CheckUserType

func CheckUserType(r *http.Request, role string) (err error)

func GenerateAllTokens

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

func HashPassword

func HashPassword(password string) string

func MatchUserTypeToUid

func MatchUserTypeToUid(r *http.Request, userId string) (err error)

func UpdateAllTokens

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

func VerifyPassword

func VerifyPassword(userPassword string, providedPassword string) (bool, string)

Types

type SignedDetails

type SignedDetails struct {
	Email      string
	First_name string
	Last_name  string
	Nickname   string
	User_type  string
	User_id    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