Skip to content

fix: include captcha failures in login lockout tracking#821

Open
Okorie2000-code wants to merge 1 commit into
MettaChain:mainfrom
Okorie2000-code:fix/captcha-failure-lockout-tracking
Open

fix: include captcha failures in login lockout tracking#821
Okorie2000-code wants to merge 1 commit into
MettaChain:mainfrom
Okorie2000-code:fix/captcha-failure-lockout-tracking

Conversation

@Okorie2000-code

Copy link
Copy Markdown

Summary

Failed CAPTCHA verification now calls recordFailedAttempt before throwing, so CAPTCHA failures participate in the same lockout mechanism as invalid password attempts.

Changes

  • src/auth/auth.service.ts: call recordFailedAttempt(email, ip, userAgent) in the CAPTCHA failure path before throwing UnauthorizedException('Invalid CAPTCHA')
  • src/auth/auth.service.captcha.spec.ts: new test suite covering CAPTCHA failure, lockout progression, password failure (regression), and successful login

Tested

  • All 27 test suites pass (175 tests)
  • Build succeeds (npm run build)
  • Lint passes (npm run lint)

Closes #689

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Okorie2000-code Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed captcha check does not call recordFailedAttempt — lockout counters bypassed

1 participant