jwtlib

package
v1.1.97 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLoginOutJWTCookie

func SetLoginOutJWTCookie(c *gin.Context, uid string) (err error)

SetLoginOutJWTCookie SetLoginOutJWTCookie

Types

type JWT

type JWT struct {
	Secret []byte
}

JWT jwt

func NewJWT

func NewJWT(secret []byte) *JWT

NewJWT new

func (*JWT) MakeJwtToken

func (j *JWT) MakeJwtToken(uid string) (string, error)

MakeJwtToken MakeJwtToken

func (*JWT) ParseToken

func (j *JWT) ParseToken(tokenString string) (uid string, err error)

ParseToken ParseToken

func (*JWT) SetJWTCookie

func (j *JWT) SetJWTCookie(c *gin.Context, uid string) (err error)

SetJWTCookie 将登录用户ID(uid)设置到cookie中

Jump to

Keyboard shortcuts

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