feat(auth): account lockout after failed login — Issue #805 - #995
Merged
github-actions[bot] merged 1 commit intoSep 28, 2026
Merged
Conversation
|
@Prozaks is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Prozaks 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! 🚀 |
- Add auth-lockout route with 5 endpoints: GET /auth/lockout/status/:identifier POST /auth/lockout/attempt POST /auth/lockout/unlock/:accountId GET /auth/lockout/attempts DELETE /auth/lockout/clear/:identifier - Add tests for route handlers (LockoutManager integration) - Add tests for AccountLockoutService (Redis-based) covering: progressive delays, lockout threshold, clearLockout, isAllowedToAttempt with all paths Closes Smartdevs17#805
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the account lockout route and comprehensive tests for Issue #805.
Existing lockout infrastructure:
src/services/account-lockout.ts— Redis-basedAccountLockoutServicesrc/services/auth/lockout-manager.ts— In-memoryLockoutManagersrc/middleware/auth-lockout.ts— Express middlewareNew files
src/routes/auth-lockout.tsA dedicated REST API for lockout management:
GET /auth/lockout/status/:identifier— check lockout statePOST /auth/lockout/attempt— record a login attempt (success or failure)POST /auth/lockout/unlock/:accountId— admin unlock with optional tokenGET /auth/lockout/attempts— list recent attemptsDELETE /auth/lockout/clear/:identifier— clear lockout stateTests
src/routes/__tests__/auth-lockout.test.ts— route + LockoutManager integration testssrc/services/__tests__/account-lockout.test.ts— AccountLockoutService unit tests (Redis mock)Test results
Closes #805