jwt

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	ID       int
	Email    string
	Name     string
	UserType []string
	jwt.StandardClaims
}

Claim adds email as a claim to the token

type Wrapper

type Wrapper struct {
	SecretKey       string
	Issuer          string
	ExpirationHours int64
}

Wrapper wraps the signing key and the issuer

func (*Wrapper) GenerateToken

func (j *Wrapper) GenerateToken(user models.User) (signedToken string, err error)

GenerateToken generates a jwt token

func (*Wrapper) ValidateToken

func (j *Wrapper) ValidateToken(signedToken string) (claims *Claim, err error)

ValidateToken validates the jwt token ValidateToken validates the jwt token

Jump to

Keyboard shortcuts

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