jwt

package
v0.0.0-...-4a8c6e9 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTokensAndSetCookies

func GenerateTokensAndSetCookies(user *user.User, c echo.Context) error

GenerateTokensAndSetCookies generates jwt token and saves it to the http-only cookie.

func JWTErrorChecker

func JWTErrorChecker(err error, c echo.Context) error

JWTErrorChecker will be executed when user try to access a protected path.

Types

type Claims

type Claims struct {
	Name string `json:"name"`
	jwt.StandardClaims
}

Create a struct that will be encoded to a JWT. We add jwt.StandardClaims as an embedded type, to provide fields like expiry time.

Jump to

Keyboard shortcuts

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