middleware

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

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSRFTokenToHeader

func CSRFTokenToHeader(next http.Handler) http.Handler

func JWTHandler

func JWTHandler(next http.Handler) http.Handler

JWTHandler protects routes with JWT token

func VerifyJWTToken

func VerifyJWTToken(signedToken string) (jwt.Claims, error)

VerifyJWTToken checks for expiry and signature

Types

type JWTToken

type JWTToken struct {
	Token string `json:"token"`
}

JWTToken represents token string

func GenerateJWT

func GenerateJWT(acct, fullname string) (JWTToken, error)

GenerateJWT creates and signs new token

Jump to

Keyboard shortcuts

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