Account lockout: login-path integration + admin unlock tests

Open
#959 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript

Research direction

Start from the BruteForceDetector unit tests added in #956 and from the security-audit-plugin audit middleware that runs on POST /auth/login. Find the existing E2E setup, then write a spec that sends repeated failed logins and checks the locked response for both the IP and email axes. Done when the new E2E spec (88+ per the acceptance criteria) passes and covers the counter reset, auto-unlock after lockoutDurationMinutes, and the admin force-unlock action.

Written by the indexing model from the issue text.

Description

area: auth enhancement priority: P2 security testing

Follow-up to #956 (auth hardening review). Missing tests on existing behavior.

Context

#956 added 14 unit tests for BruteForceDetector. Still uncovered: the full lockout lifecycle through the real login path (security-audit-plugin audit middleware on POST /auth/login).

Proposed coverage

  • Integration/E2E: N failed POST /auth/login → subsequent login returns the locked response (IP and email axes).
  • Successful login resets the failed-attempt counter.
  • Lock auto-clears after lockoutDurationMinutes (or via the admin force-unlock action in the security-audit admin UI).
  • Admin "active lockouts" list + release action covered.

Acceptance

  • E2E spec (88+) drives the lockout through real login requests and the admin unlock path.
Dominant language
TypeScript
Stars
1.8k
Forks
219
Avg merge
2d 21h
Merged PRs (30d)
67

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SonicJs-Org/sonicjs

All issues in SonicJs-Org/sonicjs

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.