auth

package
v0.0.0-...-347cd60 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash         = errors.New("the encoded hash is not in the correct format")
	ErrIncompatibleVersion = errors.New("incompatible version of argon2")
)

Functions

func ComparePasswordAndHash

func ComparePasswordAndHash(password string, id uuid.UUID, encodedHash string) (match bool, err error)

Check if a password is correct with a hash

func GenerateLoginTokenWithStep

func GenerateLoginTokenWithStep(id uuid.UUID, device string, step uint) (string, error)

func GenerateToken

func GenerateToken(tkLength int32) string

func GetLoginDataFromToken

func GetLoginDataFromToken(c *fiber.Ctx) (id uuid.UUID, device string, step uint, parseErr error)

func HashPassword

func HashPassword(password string, id uuid.UUID) (encodedHash string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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