auth

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(user *user.User) (string, error)

Encode a claim into a JWT

Types

type CustomClaims

type CustomClaims struct {
	User *user.User
	jwt.StandardClaims
}

func Decode

func Decode(tokenString string) (*CustomClaims, error)

Decode a token string into a token object

func EncodeByCtx

func EncodeByCtx(c *gin.Context) (*CustomClaims, error)

EncodeByCtx 从ctx中的token获取登录用户信息

Jump to

Keyboard shortcuts

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