From c991a54f9287703363aa6b3acff26a4531f36267 Mon Sep 17 00:00:00 2001 From: Akhil Meka Date: Mon, 4 Aug 2025 17:31:20 +0530 Subject: [PATCH] feat: return failedLoginCount in /login endpoint --- src/auth/auth.route.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/auth/auth.route.ts b/src/auth/auth.route.ts index a96b133..c8639c1 100644 --- a/src/auth/auth.route.ts +++ b/src/auth/auth.route.ts @@ -93,7 +93,12 @@ export async function authRoutes(fastify: FastifyInstance) { userInDB.faliedLoginCount++; 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(