Skip to content

Commit

Permalink
Create ErrJWTInvalid variable
Browse files Browse the repository at this point in the history
  • Loading branch information
juanbelieni committed Aug 27, 2020
1 parent 8dd25c3 commit 09f36b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions middleware/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const (
// Errors
var (
ErrJWTMissing = echo.NewHTTPError(http.StatusBadRequest, "missing or malformed jwt")
ErrJWTInvalid = echo.NewHTTPError(http.StatusUnauthorized, "invalid or expired jwt")
)

var (
Expand Down Expand Up @@ -213,8 +214,8 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
return config.ErrorHandlerWithContext(err, c)
}
return &echo.HTTPError{
Code: http.StatusUnauthorized,
Message: "invalid or expired jwt",
Code: ErrJWTInvalid.Code,
Message: ErrJWTInvalid.Message,
Internal: err,
}
}
Expand Down

0 comments on commit 09f36b5

Please sign in to comment.