middlewares

package
v0.0.0-...-e0e50ec Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JWT = &jwt.GinJWTMiddleware{
	Realm:           "Gasper",
	Key:             []byte(configs.GasperConfig.Secret),
	Timeout:         configs.JWTConfig.Timeout * time.Second,
	MaxRefresh:      configs.JWTConfig.MaxRefresh * time.Second,
	TokenLookup:     "query:token",
	TimeFunc:        time.Now,
	Authenticator:   authenticator,
	PayloadFunc:     payloadFunc,
	IdentityHandler: identityHandler,
	Authorizator:    authorizator,
	Unauthorized:    unauthorized,
}

JWT handles the auth through JWT token

Functions

func ExtractClaims

func ExtractClaims(c *gin.Context) *types.User

ExtractClaims takes the gin context and returns the User

Types

This section is empty.

Jump to

Keyboard shortcuts

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