fix(auth): relabel "Resend code" to "Send a new code" - #236
Conversation
"Resend" describes behaviour the system does not have. Every request runs generateOTP again (better-auth.ts:211,312), so a different code is emailed each time and the previous one stops working. The label implied the code already sitting in the user's inbox was still the one to type, which is precisely why the confirmation had to spell out that earlier codes are dead. "Resent!" carried the same false implication and moves with it, to "Sent!". The invalidation warning stays: a user holding two emails still benefits from being told the older code no longer works. The inline action on the OTP-expired path already said "Send a new code", so this also removes the near-duplicate labels that appeared when that action rendered ~100px above the standalone button. Raised by @aspiers reviewing #220 and deliberately scoped out of it. Implements atproto-vdz. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d07b112 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🚅 Deployed to the ePDS-pr-236 environment in ePDS
|
|
Warning Review limit reached
Next review available in: 41 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe OTP resend wording changes from “Resend code” to “Send a new code” across login and recovery flows. The success message changes from “Resent!” to “Sent!”. Unit tests, end-to-end checks, and the changeset reflect the update. ChangesOTP label update
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the auth-service passwordless OTP UI copy to avoid implying that clicking “Resend code” re-sends the same OTP, when the system actually generates a new OTP each time.
Changes:
- Relabels “Resend code” actions/buttons to “Send a new code” across login, recovery, and account sign-in flows.
- Updates the OTP send confirmation copy from “Resent!” to “Sent!”.
- Updates unit/e2e specs (Vitest + Gherkin steps) and adds a Changesets entry documenting the user-facing change.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/auth-service/src/routes/recovery.ts | Updates recovery OTP form button label to “Send a new code”. |
| packages/auth-service/src/routes/login-page.ts | Updates OTP “resend” button label, inline action label, and success message wording. |
| packages/auth-service/src/routes/account-login.ts | Updates account login OTP resend button label to “Send a new code”. |
| packages/auth-service/src/tests/login-page.test.ts | Updates assertion to expect the new inline action label string. |
| features/passwordless-authentication.feature | Updates Gherkin step text to match new button label. |
| e2e/step-definitions/auth.steps.ts | Updates step definition text to match the new button label. |
| .changeset/send-a-new-code-label.md | Adds release note describing the label/copy change for end users. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 30939396527Coverage remained the same at 57.847%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Two unreleased changesets from #220 name the button as "Resend code". Since this PR renames it, they would ship in the same release describing a control that no longer exists by that name. Also drops "the confirmation message that replaces 'Code resent!'" — that phrasing only made sense as a diff against the previous release, and the string it names is gone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (3)
packages/auth-service/src/routes/login-page.ts:1399
- This section header comment still says "Resend code", but the button label and restored text now say "Send a new code". Renaming the comment keeps the in-file documentation consistent with the UI wording.
this.textContent = 'Send a new code';
packages/auth-service/src/routes/login-page.ts:728
- The surrounding HTML comment still refers to an “inline Resend action”, but the UI label was changed to “Send a new code”. Updating the comment avoids confusing future edits/searches around this section.
<button type="button" class="btn-secondary" id="btn-resend">Send a new code</button>
packages/auth-service/src/tests/login-page.test.ts:661
- The test title still uses “inline resend”, but the user-facing action label is now “Send a new code”. Renaming the test makes it easier to understand what UI text is being asserted.
/else if \(!parLikelyDead\(\)\)[\s\S]*?showErrorWithAction\(\s*result\.error,\s*'Send a new code'/,
The comment named the button by its old label, so searching for the current one would not find the handler that implements it. Note the element id, which is not renamed: #btn-resend is referenced by e2e steps and by the inline error action, and churning it would touch several files for no user-visible gain. Raised by Copilot in review of #236. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/auth-service/src/routes/login-page.ts:1358
- This comment still refers to the "standalone Resend" button, but the UI label was changed to "Send a new code". Adjusting the wording here avoids confusing future readers (the function name still uses "Resend", but the UI label does not).
// would re-offer an action the page has deliberately
packages/auth-service/src/routes/login-page.ts:725
- A nearby HTML comment (just above this block) still says "inline Resend action", but the UI label in this region is now "Send a new code". Updating that comment keeps the in-file documentation/search terms aligned with the current UI text.
<button type="submit" class="btn-primary">Verify</button>



Implements beads issue
atproto-vdz.Why
The sign-in UI says Resend code, but nothing is ever re-sent. Each request calls
generateOTPafresh (packages/auth-service/src/better-auth.tslines 211 and 312), so a different code is emailed and the previous one stops working.That mismatch is not cosmetic. "Resend" implies the code already sitting in the user's inbox is still the one to type — which is exactly why the confirmation message had to spell out that earlier codes are dead. Naming the button for what it does removes the need to correct the user's expectation after the fact.
The confirmation itself, "Resent!", carried the same false implication and moves with it to "Sent!". The invalidation warning stays, per the decision recorded on the issue: a user holding two emails still benefits from being told the older code no longer works.
There is a secondary win. The inline error action on the OTP-expired path already said "Send a new code". Previously that rendered roughly 100px above a standalone button labelled "Resend code" — two differently-worded controls doing the same thing. They now agree.
What changed
Label, on every surface that offers another code:
packages/auth-service/src/routes/login-page.ts— the standalone#btn-resendbutton; the label restored after the transient "Sending..." state; and the inlineshowErrorWithActionlabel on the generic rejected-code branch.packages/auth-service/src/routes/account-login.ts— resend submit button.packages/auth-service/src/routes/recovery.ts— resend submit button.Confirmation message in
login-page.ts:Tests and specs tracking those labels:
packages/auth-service/src/__tests__/login-page.test.ts— the assertion pinning the inline action label.features/passwordless-authentication.featureande2e/step-definitions/auth.steps.ts— the Gherkin step names the button by its label, so both sides move together.The test asserting the clause
earlier ones no longer workneeded no change: that clause survives the rewording verbatim.resend-webhook.tsandemail/sender.tsare untouched — those refer to Resend, the email provider.Verification
pnpm format:check,pnpm lint,pnpm typecheckandpnpm test(1089 tests, 73 files) all pass.🤖 Generated with Claude Code
Summary by CodeRabbit