jwt

package
v0.0.0-...-a3b1edf Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthHeader = "Authorization"
)

Variables

View Source
var (
	ErrBadJwt = errors.New("JWT token invalid")
)

Functions

func NewJWT

func NewJWT(userID uint64, hmacSecret []byte, tokenValidityTime time.Duration) (string, error)

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	UserID uint64 `json:"AccountID"`
}

func ParseToken

func ParseToken(bearerToken string) (*Claims, error)

Jump to

Keyboard shortcuts

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