middleware

package
v0.0.0-...-3ce79b3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RequireLogin check JWT token.
	RequireLogin echo.MiddlewareFunc

	// RequireToken checks email confirmation token.
	RequireToken echo.MiddlewareFunc
)

Functions

func Init

func Init(e *echo.Echo)

Init middlewares

func RequireJSON

func RequireJSON(next echo.HandlerFunc) echo.HandlerFunc

RequireJSON requires an application/json content type.

Types

type CustomClaims

type CustomClaims struct {
	Username string `json:"username"`
	Purpose  string `json:"purpose"`
	jwt.StandardClaims
}

CustomClaims are custom claims extending default ones. Used for email confirmation and pwd reset.

type LoginCustomClaims

type LoginCustomClaims struct {
	Name  string `json:"name"`
	Admin bool   `json:"admin"`
	jwt.StandardClaims
}

LoginCustomClaims are custom claims extending default ones

Jump to

Keyboard shortcuts

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