utils

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

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

Go to latest
Published: Sep 16, 2023 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password string, hash string) bool

Internally calling the bcrypt.ComparePasswordHash()

func HashPassword

func HashPassword(password string) (string, bool)

Internally calling the bcrypt.GenerateFromPassword()

Types

type JwtWrapper

type JwtWrapper struct {
	SecretKey       string
	Issuer          string
	ExpirationHours int64
}

Token auth methods implemented on JwtWrapper

func (*JwtWrapper) GenerateToken

func (w *JwtWrapper) GenerateToken(user models.User) (signedToken string, err error)

func (*JwtWrapper) ValidateToken

func (w *JwtWrapper) ValidateToken(signedToken string) (claims *jwtClaims, err error)

Jump to

Keyboard shortcuts

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