feat: return failedLoginCount in /login endpoint
This commit is contained in:
@@ -93,7 +93,12 @@ export async function authRoutes(fastify: FastifyInstance) {
|
|||||||
userInDB.faliedLoginCount++;
|
userInDB.faliedLoginCount++;
|
||||||
await userInDB.save();
|
await userInDB.save();
|
||||||
|
|
||||||
return res.code(401).send({ error: "invalid email or password" });
|
return res
|
||||||
|
.code(401)
|
||||||
|
.send({
|
||||||
|
error: "invalid email or password",
|
||||||
|
failedLoginCount: userInDB.faliedLoginCount,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const newSession = await createSession(
|
const newSession = await createSession(
|
||||||
|
|||||||
Reference in New Issue
Block a user