Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JwtWithAuthInfo ¶
func JwtWithAuthInfo(jt *Token) middleware.Middleware
func WithLoginContext ¶
func WithLoginContext(ctx context.Context, loginInfo *CustomClaims) context.Context
Types ¶
type CustomClaims ¶
type CustomClaims struct { UserName string `json:"user_name"` UserID int64 `json:"uid"` Role string `json:"role"` jwt.StandardClaims }
CustomClaims 自定义的 metadata在加密后作为 JWT 的第二部分返回给客户端
func FormLoginContext ¶
func FormLoginContext(ctx context.Context) *CustomClaims
type LoginInfoKey ¶
type LoginInfoKey struct{}
Click to show internal directories.
Click to hide internal directories.