From 8cd6190513d8a75974aed257c2bca2234f9b43e9 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Wed, 17 Feb 2021 18:13:51 +0100 Subject: [PATCH] :art: show proper auth error --- src/middlewares/Authentication.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); } }