Skip to content

Commit

Permalink
fix: validate token
Browse files Browse the repository at this point in the history
  • Loading branch information
veryCrunchy committed Apr 22, 2024
1 parent 8d5c941 commit 8056530
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/routes/validateToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand Down

0 comments on commit 8056530

Please sign in to comment.