diff --git a/src/app/routes/auth.ts b/src/app/routes/auth.ts index 566044cf..6007b998 100644 --- a/src/app/routes/auth.ts +++ b/src/app/routes/auth.ts @@ -125,7 +125,7 @@ export class AuthController { const loginAttemptsLimitReached = userData.errorLoginCount >= MAX_LOGIN_FAIL_ATTEMPTS; if (loginAttemptsLimitReached) { - throw createHttpError(401, 'Your account has been blocked for security reasons. Please reach out to us'); + throw createHttpError(403, 'Your account has been blocked for security reasons. Please reach out to us'); } const hashedPass = this.service.Crypt.decryptText(req.body.password); diff --git a/tests/e2e/e2e-spec.ts b/tests/e2e/e2e-spec.ts index 47783294..9a83cc90 100644 --- a/tests/e2e/e2e-spec.ts +++ b/tests/e2e/e2e-spec.ts @@ -897,7 +897,7 @@ describe('E2E TEST', () => { .post('/api/access') .send({ ...TEST_USER_LOGIN_BODY }); - expect(status).toBe(HttpStatus.UNAUTHORIZED); + expect(status).toBe(HttpStatus.FORBIDDEN); expect(body.error).toBe('Your account has been blocked for security reasons. Please reach out to us'); }); });