jwt

package
v1.0.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginCheck

type LoginCheck struct {
	HmacSecret []byte
}

func SetupLoginCheck

func SetupLoginCheck() *LoginCheck

func (*LoginCheck) CreateToken

func (m *LoginCheck) CreateToken(claims LoginClaimsPayload) (string, error)

CreateToken create one token

func (*LoginCheck) VerifyToken

func (m *LoginCheck) VerifyToken(tokenString string) (*gojwt.Token, error)

VerifyToken verify token is valid

type LoginClaims

type LoginClaims struct {
	*gojwt.StandardClaims
	LoginClaimsPayload
}

LoginClaims clasims for Login

type LoginClaimsPayload

type LoginClaimsPayload struct {
	SN       string `json:"sn"`
	Signture string `json:"st"`
}

LoginClaims clasims payload for Login

Jump to

Keyboard shortcuts

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