diff --git a/src/middlewares/Authentication.ts b/src/middlewares/Authentication.ts index 2bb8a124..40ada88e 100644 --- a/src/middlewares/Authentication.ts +++ b/src/middlewares/Authentication.ts @@ -25,6 +25,6 @@ export async function Authentication(req: Request, res: Response, next: NextFunc req.userid = decoded.id; return next(); } catch (error) { - return next(error); + return next(new HTTPError(error.toString(), 400)); } }