helpers

package
v0.0.0-...-57b3fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpiredToken = errors.New("token has expired")
	ErrInvalidToken = errors.New("token is invalid")
)

Functions

func CreateToken

func CreateToken(user db.User, duration time.Duration, key string) (string, error)

func ReIssueAccessToken

func ReIssueAccessToken(refreshToken string, REFRESH_TOKEN_KEY string, ACCESS_TOKEN_KEY string, storage *db.SQLCStore, ctx context.Context) string

Types

type JwtClaims

type JwtClaims struct {
	db.User
	jwt.RegisteredClaims
}

func VerifyToken

func VerifyToken(token, key string) (*JwtClaims, bool, error)

Jump to

Keyboard shortcuts

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