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