From 8056530a89bac22842f2a13393b1825150f25716 Mon Sep 17 00:00:00 2001 From: veryCrunchy Date: Tue, 23 Apr 2024 01:44:01 +0200 Subject: [PATCH] fix: validate token --- src/routes/validateToken.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/routes/validateToken.ts b/src/routes/validateToken.ts index c721aad..301b8bb 100644 --- a/src/routes/validateToken.ts +++ b/src/routes/validateToken.ts @@ -5,13 +5,12 @@ export const router = Router(); router.get("/token/validate", async (req, res) => { const token = req.headers.authorization; - if (!token) return res.send(400); - + if (!token) return res.sendStatus(400); try { await verifyAuth(token); - res.status(200); + res.sendStatus(200); } catch (e) { - res.status(401).send((e as Error).message); + res.sendStatus(401); } });