auth

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateEvent string = "Create"
	UpdateEvent string = "Update"
	DeleteEvent string = "Delete"
)

Variables

This section is empty.

Functions

func ComparePasswords

func ComparePasswords(hashed, plain string) bool

ComparePasswords compare the hashed and plain passwords

func GenerateJWT

func GenerateJWT(username, email string) (string, error)

func GeneratePwd

func GeneratePwd() (string, error)

func HashAndSalt

func HashAndSalt(password string) (string, error)

HashAndSalt hash and salt the password

func IsAuditEvent

func IsAuditEvent(eventName string) bool

func SendResetPasswordEmail

func SendResetPasswordEmail(email, token string) error

func SendVerificationEmail

func SendVerificationEmail(email, token string) error

func VerifyTokenWithGateway

func VerifyTokenWithGateway(token string, gatewayURL string) (bool, error)

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	jwt.RegisteredClaims
}

func ValidateJWT

func ValidateJWT(tokenString string) (*Claims, error)

Jump to

Keyboard shortcuts

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