mirror of
https://github.com/labstack/echo.git
synced 2025-01-26 03:20:08 +02:00
Create ErrJWTInvalid variable
This commit is contained in:
parent
8dd25c39ce
commit
09f36b585d
@ -86,6 +86,7 @@ const (
|
|||||||
// Errors
|
// Errors
|
||||||
var (
|
var (
|
||||||
ErrJWTMissing = echo.NewHTTPError(http.StatusBadRequest, "missing or malformed jwt")
|
ErrJWTMissing = echo.NewHTTPError(http.StatusBadRequest, "missing or malformed jwt")
|
||||||
|
ErrJWTInvalid = echo.NewHTTPError(http.StatusUnauthorized, "invalid or expired jwt")
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -213,8 +214,8 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
|
|||||||
return config.ErrorHandlerWithContext(err, c)
|
return config.ErrorHandlerWithContext(err, c)
|
||||||
}
|
}
|
||||||
return &echo.HTTPError{
|
return &echo.HTTPError{
|
||||||
Code: http.StatusUnauthorized,
|
Code: ErrJWTInvalid.Code,
|
||||||
Message: "invalid or expired jwt",
|
Message: ErrJWTInvalid.Message,
|
||||||
Internal: err,
|
Internal: err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user