auth

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingJwtExpiration   = errors.New("missing configuration: JwtExpiration")
	ErrMissingJwtSecretKey    = errors.New("missing configuration: JwtSecretKey")
	ErrInvalidAccessTokenExp  = errors.New("invalid access token expiration value")
	ErrInvalidRefreshTokenExp = errors.New("invalid refresh token expiration value")
	ErrFailedToGenerateToken  = errors.New("failed to generate token")
)

Errors used in the function

Functions

func CreateTokens

func CreateTokens(userId uint, role string, app *app.App, refreshExp uint) (string, string, error)

CreateTokens generates access and refresh tokens

func ValidateToken

func ValidateToken(tokenString string) (jwt.MapClaims, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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