tokenhandler

package
v0.0.0-...-6c79d6b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTokenDuration    = 15 * time.Hour
	RefreshTokenDuration = 48 * time.Hour
)

Variables

View Source
var (
	ErrInvalidSigningMethod = errors.New("invalid token signing method")
	ErrInvalidToken         = errors.New("invalid token")
)

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UserId string `json:"user_id"`
	jwt.StandardClaims
}

type TokenHandler

type TokenHandler interface {
	ValidateToken(token string) (*Claims, error)
	NewToken(userId string, expirationTime time.Time) (string, error)
}

func New

func New(secret string) TokenHandler

Jump to

Keyboard shortcuts

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