auth

package
v0.0.0-...-aedb146 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidTokens = &invalidTokenStore{
	tokens: make(map[int]*time.Time),
	mu:     new(sync.RWMutex),
}

Functions

func API

func API(g *gin.RouterGroup)

func CreateMiddleware

func CreateMiddleware() (gin.HandlerFunc, error)

func VerifyToken

func VerifyToken(tokenString string, claims *JWTClaims) (token *jwt.Token, expired bool, err error)

Types

type JWTClaims

type JWTClaims struct {
	TokenID    int   `json:"tokenID"`
	RenewUntil int64 `json:"renewUntil"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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