jwt

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	SetLoginToken(ctx *gin.Context, uid int, username string, accountType int8) (string, string, error)
	SetJWTToken(ctx *gin.Context, uid int, username string, ssid string, accountType int8) (string, error)
	ExtractToken(ctx *gin.Context) string
	CheckSession(ctx *gin.Context, ssid string) error
	ClearToken(ctx *gin.Context) error
	// contains filtered or unexported methods
}

func NewJWTHandler

func NewJWTHandler(c redis.Cmdable) Handler

type RefreshClaims

type RefreshClaims struct {
	jwt.RegisteredClaims
	Uid         int
	Username    string
	Ssid        string
	AccountType int8
}

type UserClaims

type UserClaims struct {
	jwt.RegisteredClaims
	Uid         int
	Username    string
	Ssid        string
	UserAgent   string
	ContentType string
	AccountType int8
}

Jump to

Keyboard shortcuts

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