utils

package
v0.0.0-...-6fdab23 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RefreshTokenCollection *mongo.Collection = database.GetCollection(database.DB, "RefreshToken")
View Source
var Validate = validator.New()

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func GenerateOtp

func GenerateOtp() int

func HashPassword

func HashPassword(password string) (string, error)

func SendEmail

func SendEmail(to string, subject, body string) error

Types

type Token

type Token struct {
	AccessToken struct {
		Token     string `json:"token"`
		ExpiresAt int64  `json:"expiresAt"`
	} `json:"accessToken"`
	RefreshToken struct {
		Token     string `json:"token"`
		ExpiresAt int64  `json:"expiresAt"`
	} `json:"refreshToken"`
}

func CreateJWTTokenRunner

func CreateJWTTokenRunner(runner models.Runner) (*Token, error)

func CreateJWTTokenUser

func CreateJWTTokenUser(user models.User, PhoneAvailable bool) (*Token, error)

Jump to

Keyboard shortcuts

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