From 9d8c89f4e905869200ceeb7c621d3ee795e4b552 Mon Sep 17 00:00:00 2001 From: Akhil Meka Date: Mon, 28 Jul 2025 11:35:04 +0530 Subject: [PATCH] add error message when account doesn't have password --- src/auth/auth.route.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/auth/auth.route.ts b/src/auth/auth.route.ts index d3862da..d4cb02f 100644 --- a/src/auth/auth.route.ts +++ b/src/auth/auth.route.ts @@ -76,6 +76,9 @@ export async function authRoutes(fastify: FastifyInstance) { if (!userInDB) return res.code(401).send({ error: "invalid email or password" }); + if (!userInDB.passwordHash) + return res.code(401).send({ error: "invalid email or password" }); + const match = await verify(userInDB.passwordHash, password); if (!match) return res.code(401).send({ error: "invalid email or password" });