auth

package
v0.0.0-...-749ad85 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccessToken

func CreateAccessToken(id, email, role string) (string, error)

CreateToken generates a JWT for a given user email and role.

func CreateTokenPair

func CreateTokenPair(id, email, role string) (accessToken string, refreshToken string, err error)

CreateTokenPair generates an access and a refresh token for a given user email and role.

func HashPassword

func HashPassword(password string) (string, error)

func RefreshAccessToken

func RefreshAccessToken(refreshToken string) (string, error)

func VerifyPassword

func VerifyPassword(hashedPassword, password string) error

VerifyPassword compares a hashed password with its possible plaintext equivalent.

func VerifyToken

func VerifyToken(tokenString string) (*jwt.Token, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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