midware

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JwtCookieKey = "VegeJwtToken"
	JwtCtxErrKey = "VegeJwtCtxErr"
	JwtCtxMcKey  = "VegeJwtCtxMc"
)

Variables

This section is empty.

Functions

func GetMcFromCtx

func GetMcFromCtx(ctx *gin.Context) (mc *jwtApi.MyClaims, err error)

GetMcFromCtx 从ctx取得 mc

func GetTokenObjFromCtx added in v1.0.8

func GetTokenObjFromCtx(ctx *gin.Context, obj any) error

GetTokenObjFromCtx form ctx 取得 mc 并且将token JsonUnmarshal 到obj中,要求obj为对象地址

func JWTAuthMiddleware

func JWTAuthMiddleware() gin.HandlerFunc

JWTAuthMiddleware 基于JWT认证中间件

func SetJwtObj

func SetJwtObj(obj *jwtApi.JwtCfg)

SetJwtObj 只允许调用一次

Types

This section is empty.

Jump to

Keyboard shortcuts

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