Skip to content

Commit 4e9b83b

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

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
@@ -254,10 +254,10 @@ func (config Config) ToMiddleware() (echo.MiddlewareFunc, error) {
254254
}
255255

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

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

0 commit comments

Comments
 (0)