Skip to content

P1: fix(auth): offer recovery after OTP lockout - #217

Draft
aspiers wants to merge 1 commit into
mainfrom
split-pr165/otp-lockout-recovery
Draft

P1: fix(auth): offer recovery after OTP lockout#217
aspiers wants to merge 1 commit into
mainfrom
split-pr165/otp-lockout-recovery

Conversation

@aspiers

@aspiers aspiers commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Give users a clear way forward after better-auth rejects further attempts for an OTP. Interactive sign-in can send a new code, while account settings and recovery show honest guidance instead of implying that the locked code can still work.

Changes

  • Classify only the specific too-many-attempts response as lockout
  • Offer an inline resend action while the authorization flow is still live
  • Share lockout-aware error guidance across account login and recovery
  • Add focused unit and Cucumber coverage

Testing

  • pnpm format:check
  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm test:coverage
  • Cucumber dry run with the required test URLs

Screenshots

Before: lockout produced a dead-end error with no direct recovery action.

Before: OTP lockout dead end

After: the lockout state offers an inline Send a new code action. The preview response was controlled to isolate the final rendered state, including the sentence punctuation before the action.

After: OTP lockout recovery action

Notes

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
epds-demo Ready Ready Preview Aug 4, 2026 10:16pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 664a90dc-ebb3-4e9a-a27f-e995d7416d1f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2e00832

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-217 July 30, 2026 13:38 Destroyed
@railway-app

railway-app Bot commented Jul 30, 2026

Copy link
Copy Markdown

🚅 Deployed to the ePDS-pr-217 environment in ePDS

Service Status Web Updated (UTC)
@certified-app/demo ✅ Success (View Logs) Web Aug 4, 2026 at 10:16 pm
@certified-app/demo untrusted ✅ Success (View Logs) Web Aug 4, 2026 at 10:16 pm
@certified-app/auth-service ✅ Success (View Logs) Web Aug 4, 2026 at 10:15 pm
@certified-app/pds-core ✅ Success (View Logs) Web Aug 4, 2026 at 10:15 pm

@coveralls-official

coveralls-official Bot commented Jul 30, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30955683423

Coverage increased (+0.2%) to 58.124%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (6 of 7 lines covered, 85.71%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
packages/auth-service/src/routes/recovery.ts 1 0 0.0%
Total (2 files) 7 6 85.71%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
packages/auth-service/src/routes/account-login.ts 1 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 3111
Covered Lines: 1795
Line Coverage: 57.7%
Relevant Branches: 1942
Covered Branches: 1142
Branch Coverage: 58.81%
Branches in Coverage %: Yes
Coverage Strength: 9.78 hits per line

💛 - Coveralls

@blacksmith-sh

This comment has been minimized.

@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-217 July 30, 2026 13:51 Destroyed
@aspiers aspiers changed the title fix(auth): offer recovery after OTP lockout P1: fix(auth): offer recovery after OTP lockout Jul 30, 2026
@aspiers
aspiers force-pushed the split-pr165/otp-lockout-recovery branch from 16b752a to 525cee0 Compare July 30, 2026 15:39
@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-217 July 30, 2026 15:40 Destroyed
Comment thread .changeset/inline-resend-on-too-many-attempts.md Outdated
@aspiers

aspiers commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

There needs to be a . in between "Too many attempts" and "Send new code".

@aspiers
aspiers force-pushed the split-pr165/otp-lockout-recovery branch from 525cee0 to 5bb0c81 Compare July 30, 2026 16:36
@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-217 July 30, 2026 16:36 Destroyed
@aspiers
aspiers force-pushed the split-pr165/otp-lockout-recovery branch from 5bb0c81 to 62729b9 Compare July 30, 2026 16:37
@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-217 July 30, 2026 16:37 Destroyed
@aspiers
aspiers force-pushed the split-pr165/otp-lockout-recovery branch from 62729b9 to 66a7cf9 Compare July 30, 2026 16:56
@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-217 July 30, 2026 16:57 Destroyed
@aspiers

aspiers commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

(reply generated by OpenAI Codex)

Addressed the punctuation feedback in 66a7cf9. Inline actions now add a period when the error text lacks terminal punctuation, and the browser step asserts the rendered .<space>Send a new code contract.

@aspiers

aspiers commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

(reply generated by OpenAI Codex)

Follow-up on the punctuation feedback: the PR description’s after screenshot has also been refreshed from the corrected renderer and now visibly shows “Too many attempts. Send a new code”.

@aspiers

aspiers commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

(reply generated by OpenAI Codex)

CI context: the latest PR-attached E2E job did not execute the suite; it timed out waiting for Railway to mark deployment 66a7cf9 successful. Railway has an active build/deployment delay incident. The explicit environment run reached the suite but confirmed the preview still serves the prior revision, so I am not treating that run as validation of this final amendment.

@aspiers

aspiers commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

(reply generated by OpenAI Codex)

Railway’s incident is resolved, the final deployment completed, and the current SHA now passes the full deployed E2E suite: https://github.com/hypercerts-org/ePDS/actions/runs/30563779378

@aspiers
aspiers force-pushed the split-pr165/otp-lockout-recovery branch from 66a7cf9 to 104bd75 Compare August 4, 2026 22:09
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@blacksmith-sh

This comment has been minimized.

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.

1 participant