View definition

func JWT(key []byte) MiddlewareFunc

Defined in github.com/labstack/echo/middleware/jwt.go

Description

JWT returns a JSON Web Token (JWT) auth middleware.

For valid token, it sets the user in context and calls next handler. For invalid token, it returns “401 - Unauthorized” error. For empty token, it returns “400 - Bad Request” error.

See: https://jwt.io/introduction See JWTConfig.TokenLookup