updated error messages
This commit is contained in:
@@ -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" });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user