Repository navigation
fix(login): show rate-limit copy for a passkey 429 and keep the session (TASK-22431) - #4079
Conversation
…(TASK-22431) A 429 from /passkeys/*/options showed 'couldn't reach servers', and a 429 from /login/verify fell through to LOGIN_ERROR, which clears auth state. The fetch wrapper now throws PasskeyRateLimitedError on any passkey 429; it classifies as RATE_LIMITED with 'too many attempts, wait a minute' copy in all four app locales, and login keeps the session.
…SK-22431) After a passkey verifies, login reads /users/me. A 429 there was retried and then shown as 'couldn't reach servers'. It now stops at once (retries only spend the shared IP budget) and shows the rate-limit copy.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code-analysis diffPainscore total: 11089.4 → 11090.26 (+0.86) 🆕 New findings (19)
✅ Resolved (19)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
There was a problem hiding this comment.
Chip review — no blocking findings — this is not an approval
No findings in the passkey rate-limit handling change.
Checked clean
- 429s from all four passkey paths become a rate-limit error before ZeroDev decodes the response; no verify token is stashed on failure.
- Login preserves existing auth state and displays localized rate-limit copy; signup displays the same copy.
- Session hydration propagates a /users/me 429 immediately, and the user query already disables retries for 429.
- Exact-head CI reported ci-success; one screenshot capture check was still in progress when checked.
Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.
Third opinion by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.
Copy check by claude-haiku-5-5: 0 finding(s), titled "Copy now wrong". Every quoted passage was checked against the file.
Exact head: a32f4b523d88 · Context: repo, product, sibling_api, ci · Took 5m (queued 1m)
dev added a retry window for login/verify 429 and 5xx (PasskeyVerifyRetryableError) and reserved-username handling. keep both: login/verify 429 keeps dev's retry window and now shows the rate-limit copy; every other passkey 429 still maps to PasskeyRateLimitedError.
the merge commit staged the worktree's older checkout and reverted dev's bump; this PR must not change the gitlink.
…it copy Dev's notifications rework and QR network pills left 6 stale and 2 unshown keys that only a full PR capture catches. setup.passkey.rateLimited needs a mid-ceremony 429 the harness cannot fake, like every other passkey error key.
There was a problem hiding this comment.
Chip review — no blocking findings — this is not an approval
One signup rate-limit message gives a retry time that can be too short.
Findings
- MAJOR · src/i18n/app/messages/en.json:1167 · Signup rate-limit copy promises one minute for an hourly cap
The API applies a separate 20-per-IP, one-hour limit to /passkeys/register/verify (src/routes/passkey/index.ts, registrationRateLimit). If an IP reaches that cap near the start of the hour, this PR maps its 429 to the same message as the one-minute login/options limits, telling the user to retry in a minute while registration remains blocked for much longer. The same timing claim appears in the other three locales. Use a duration-neutral message for this path or surface the server retry time.
Checked clean
- Exact-head diff against the supplied dev base isolates the passkey change and Screen Library copy-baseline update.
- Login/verify 429 retains its bounded retry window and classifies as RATE_LIMITED without clearing auth state; options and hydration 429s also preserve the session.
- The copy-baseline exception is present in the PR description; its additional keys reconcile inherited dev capture drift.
- Exact-head CI had no failed checks when checked; several checks, including unit and screen capture, were still in progress.
Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.
Third opinion: did not run — it reads only the first review of a pull request; the first reviewer checks later rounds. This review is one reviewer short.
Copy check by claude-haiku-5-5: 0 finding(s), titled "Copy now wrong". Every quoted passage was checked against the file.
Exact head: daada76d9be7 · Context: repo, sibling_api, ci · Took 2m
The API keeps dev's 20-per-hour cap on /passkeys/register/verify, so "wait a minute" can be false for up to an hour.
Problem
A passkey 429 from the API (rate limit, see the API PR) showed the wrong thing:
/passkeys/*/options→ "Couldn’t reach Peanut’s servers. Check your connection…" (NETWORK)./passkeys/login/verify→ ZeroDev read the error body as a success, threw "Login not verified", and it classified as LOGIN_ERROR. That path clears auth state.Sentry PEANUT-UI-T34.
Fix
passkey-auth-capture.ts: any/passkeys/*response with status 429 throwsPasskeyRateLimitedErrorbefore ZeroDev reads the body.webauthn.utils.ts: new codeRATE_LIMITED, copy "Too many attempts. Wait a minute and try again.", i18n keysetup.passkey.rateLimited.useZeroDevlogin:RATE_LIMITEDkeeps the session and reports a Sentry warning taggedpasskey_rate_limited.useSignupPasskey: signup shows the same copy.login-session.ts: a 429 on/users/meduring session hydration stops retrying and throws the same error (retries only spend the shared IP budget).setup.passkey.rateLimitedin en, es-419, es-AR and pt-BR.Tests
passkey-auth-capture.test.ts: 429 on each of the 4 passkey paths throwsPasskeyRateLimitedError.webauthn.utils.test.ts: classifies asRATE_LIMITEDwith its copy and key.useZeroDev-login-failure.test.tsx: 429 on login options and verify keeps auth state (fails without the hook change).useSignupPasskey.test.tsx: signup shows the rate-limit copy.login-session.test.ts: a hydration 429 stops at once with the rate-limit error.src/contentsubmodule is not checked out in this worktree. None of those suites touch changed files.Not verified
/auth/step-up/*viaapiFetch) 429s are not mapped; that flow keeps its existing errors.tscreports 176 missing-asset module errors in a fresh worktree, none in changed files. CI runs the real typecheck.Decisions (Kush, TASK-22431)
Coupled PR (api-contract)
peanut-api-ts PR: https://github.com/peanutprotocol/peanut-api-ts/pull/2125. The UI branches on HTTP status 429 only, which the API returns today from the global limit and after the API PR from the login limit. No body shape is read. Either PR can ship first.
Screen Library copy exception: setup.passkey.rateLimited needs a 429 from the passkey API mid-ceremony, which the capture harness cannot fake; no setup.passkey error has a capture state. The baseline also picks up dev drift (2 new unshown keys, 6 now-shown keys).
🤖 Generated with Claude Code