utils

package
v0.0.0-...-c67561b Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserCredential

func CheckUserCredential(user *domain.User, mail, pasword, pin string) error

func GenerateToken

func GenerateToken(ttl time.Duration, payload interface{}, secretJWTKey string) (string, error)

func GetOtpUrl

func GetOtpUrl(user *domain.User) string

func HashPassword

func HashPassword(password string) (string, error)

func ParseTemplateDir

func ParseTemplateDir(dir string) (*template.Template, error)

👇 Email template parser

func SendEmail

func SendEmail(user *domain.User, config domain.SysConfig)

func ValidateToken

func ValidateToken(token string, signedJWTKey string) (interface{}, error)

func VerifyPassword

func VerifyPassword(hashedPassword string, candidatePassword string) error

Types

type EmailData

type EmailData struct {
	URL       string
	FirstName string
	Subject   string
}

Jump to

Keyboard shortcuts

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