jwt

package
v0.0.0-...-900ead6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractToken

func ExtractToken(c *gin.Context) *string

ExtractToken return jwt token string or nil

func Setup

func Setup()

Setup init jwt

func Verify

func Verify(token string) (*jwt.Token, error)

Verify verify token sign

Types

type Configure

type Configure struct {
	JwtSecret string `env:"JWT_SECRET" envDefault:"Y8TzKMOY5QACbF71m..."`
	TTL       int64  `env:"JWT_TTL" envDefault:"1"`   // 1 hour
	TRT       int64  `env:"JWT_TRT" envDefault:"168"` // 7 days
}

Configure config for jwt

var Config Configure

Config global defined jwt config

Jump to

Keyboard shortcuts

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