account

package
v0.0.0-...-558f0ad Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var INTEGER_TABLE = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}
View Source
var SECRET_KEY string = viper.GetString("jwtKey")

Functions

func CheckUserType

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

func EncodeToString

func EncodeToString(max int) string

EncodeToString is used to create a 6 digit verification code

func GenerateAllTokens

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

func HashPassword

func HashPassword(password string) string

HashPassword is used to encrypt the password before storage

func MatchUserTypeToUid

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

func UpdateAllTokens

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

func VerifyPassword

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

VerifyPassword checks the hashes of 2 passwords are equal

Types

type SignedDetails

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