add error message when account doesn't have password
This commit is contained in:
@@ -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" });
|
||||
|
||||
Reference in New Issue
Block a user