auth

package
v0.0.0-...-1084665 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptPassword

func EncryptPassword(password string) string

EncryptPassword is used to encrypt a password using bcrypt

func GenerateConfirmHash

func GenerateConfirmHash() (string, error)

GenerateConfirmHash generates a hash that can be used in for example password confirm mails

func GenerateJWT

func GenerateJWT(userID interface{}, signingKey string, expiresIn time.Duration) (string, error)

GenerateJWT generates JWT token, based on roleID and userID

func GenerateRandomPassword

func GenerateRandomPassword(length int) string

GenerateRandomPassword is used to generate a random password based on letters from the letters variable and specified length

func VerifyJWT

func VerifyJWT(theToken string, signingKey string) (map[string]interface{}, error)

VerifyJWT is used to verify a jwt token, and return its claims

func VerifyPassword

func VerifyPassword(password, hashedPassword string) error

VerifyPassword is used to compare password against hash in db

Types

This section is empty.

Jump to

Keyboard shortcuts

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