auth

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

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

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, id, encodedHash string) (match bool, err error)

Check if a password is correct with a hash

func GenerateLoginTokenWithStep

func GenerateLoginTokenWithStep(id string, device string, step uint) (string, error)

func GenerateToken

func GenerateToken(tkLength int32) string

func GetLoginDataFromToken

func GetLoginDataFromToken(c *fiber.Ctx) (id string, device string, step uint)

func HashPassword

func HashPassword(password string, id string) (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