From ee7496305800bb19ed9f074dedcacb9952e75b00 Mon Sep 17 00:00:00 2001 From: Akhil Meka Date: Thu, 24 Jul 2025 19:17:21 +0530 Subject: [PATCH] updated error messages --- src/webauthn/webauthn.route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webauthn/webauthn.route.ts b/src/webauthn/webauthn.route.ts index a38c343..034cc60 100644 --- a/src/webauthn/webauthn.route.ts +++ b/src/webauthn/webauthn.route.ts @@ -33,11 +33,11 @@ export async function webAuthnRoutes(fastify: FastifyInstance) { const { token } = req.body; if (!token) { - return res.code(400).send({ error: "bad request" }); + return res.code(400).send({ error: "missing token" }); } const userInDB = await getUserByToken(token); - if (!userInDB) return res.code(400).send({ error: "bad request" }); + if (!userInDB) return res.code(404).send({ error: "not found" }); if (new Date() > userInDB.token.expiry) return res.code(400).send({ error: "link expired" });