Skip to content

Commit b4d6b80

Browse files
committed
Use ErrJWTMissing and ErrJWTInvalid clones when returning the errors. So response code could be configured more easily
1 parent 5bf5dc0 commit b4d6b80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jwt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ func (config Config) ToMiddleware() (echo.MiddlewareFunc, error) {
253253
}
254254

255255
if lastTokenErr == nil {
256-
return echo.NewHTTPError(http.StatusUnauthorized, "missing or malformed jwt").SetInternal(err)
256+
return ErrJWTMissing.WithInternal(err)
257257
}
258258

259-
return echo.NewHTTPError(http.StatusUnauthorized, "invalid or expired jwt").SetInternal(err)
259+
return ErrJWTInvalid.WithInternal(err)
260260
}
261261
}, nil
262262
}

0 commit comments

Comments
 (0)