tjwt

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJWT

func DecodeJWT(token string) (userId string, data any, err error)

func DecodeRefreshJWT

func DecodeRefreshJWT(token string) (userId string, err error)

Types

type Claims

type Claims struct {
	UserId string `json:"user_id"`
	Data   any    `json:"data"`
	jwt.StandardClaims
}

func NewClaims

func NewClaims(userId string, data any) *Claims

func (*Claims) GenerateJWT

func (c *Claims) GenerateJWT() (tokenStr string, refreshTokenStr string, err error)

type RefreshClaims

type RefreshClaims struct {
	UserId string `json:"user_id"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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