Back to godoc.org

Package middleware

v0.0.0-...-b1379b6
Latest Go to latest

The highest tagged major version is .

Published: Oct 15, 2020 | License: Apache-2.0 | Module: github.com/saferwall/saferwall/web

Index

Variables

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

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

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.

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier