middlewares

package
v0.0.0-...-870aec1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Salt = []byte("ChiAuthSalt")

Functions

func Authenticate

func Authenticate(next http.Handler) http.Handler

func GenJWT

func GenJWT(uname string) (string, error)

func MethodCheck

func MethodCheck(next http.Handler) http.Handler

Chi by default doesnt show message for 405 error text This middleware checks the gloobal router context and displays an error message of "Method not Allowed"

Types

type UserDataClaims

type UserDataClaims struct {
	Uname string `json:"uname"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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