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" });