jwt

package
v0.0.0-...-9192568 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenExpired = errors.New("jwt: token expired")
	ErrTokenSigning = errors.New("jwt: unexpected token signing method")
	ErrTokenClaims  = errors.New("jwt: failed to extract claims from a token")
)

Functions

func EncodeToken

func EncodeToken(uid string, expTime time.Duration) (string, error)

EncodeToken creates a token string with encoded user ID and expiry time.

func GetUserIDFromToken

func GetUserIDFromToken(token string) (string, error)

GetUserIDFromToken returns the encoded user ID from a token string.

func IsTokenExpired

func IsTokenExpired(token string) (bool, error)

IsTokenExpired checks if a token is expired.

Types

This section is empty.

Jump to

Keyboard shortcuts

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