Skip to content

fix(auth): relabel "Resend code" to "Send a new code" - #236

Merged
aspiers merged 3 commits into
mainfrom
fix/send-new-code-label
Aug 4, 2026
Merged

fix(auth): relabel "Resend code" to "Send a new code"#236
aspiers merged 3 commits into
mainfrom
fix/send-new-code-label

Conversation

@aspiers

@aspiers aspiers commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Implements beads issue atproto-vdz.

Why

The sign-in UI says Resend code, but nothing is ever re-sent. Each request calls generateOTP afresh (packages/auth-service/src/better-auth.ts lines 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-resend button; the label restored after the transient "Sending..." state; and the inline showErrorWithAction label 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:

- 'Resent! Make sure to use the new code; earlier ones no longer work. ...'
+ 'Sent! Make sure to use the new code; earlier ones no longer work. ...'

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.feature and e2e/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 work needed no change: that clause survives the rewording verbatim.

resend-webhook.ts and email/sender.ts are untouched — those refer to Resend, the email provider.

Verification

pnpm format:check, pnpm lint, pnpm typecheck and pnpm test (1089 tests, 73 files) all pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Updated sign-in and account recovery wording from “Resend code” to “Send a new code.”
    • Applied the new label to verification buttons, loading states, error prompts, and confirmation messages.
    • Updated messaging across expired, rejected, recovery, and account sign-in code flows.

"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>
Copilot AI lite review requested due to automatic review settings August 4, 2026 18:18
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest 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

@vercel

vercel Bot commented Aug 4, 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 6:37pm

Request Review

@railway-app

railway-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

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

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aspiers, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9017d0bb-8a67-4578-bdbf-ed71e5ad03d3

📥 Commits

Reviewing files that changed from the base of the PR and between e238c38 and d07b112.

📒 Files selected for processing (3)
  • .changeset/clear-otp-boxes-on-resend.md
  • .changeset/sign-in-errors-at-point-of-failure.md
  • packages/auth-service/src/routes/login-page.ts
📝 Walkthrough

Walkthrough

The 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.

Changes

OTP label update

Layer / File(s) Summary
Authentication route wording
packages/auth-service/src/routes/account-login.ts, packages/auth-service/src/routes/login-page.ts, packages/auth-service/src/routes/recovery.ts
OTP actions use “Send a new code”. The success message uses “Sent!”.
Validation and release updates
packages/auth-service/src/__tests__/login-page.test.ts, e2e/step-definitions/auth.steps.ts, features/passwordless-authentication.feature, .changeset/send-a-new-code-label.md
Tests and end-to-end scenarios expect the new wording. The changeset documents the patch release update.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main authentication label change from "Resend code" to "Send a new code".
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/send-new-code-label

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .changeset/send-a-new-code-label.md
Comment thread packages/auth-service/src/routes/login-page.ts
@coveralls-official

coveralls-official Bot commented Aug 4, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30939396527

Coverage remained the same at 57.847%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3099
Covered Lines: 1785
Line Coverage: 57.6%
Relevant Branches: 1935
Covered Branches: 1127
Branch Coverage: 58.24%
Branches in Coverage %: Yes
Coverage Strength: 9.51 hits per line

💛 - 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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings August 4, 2026 18:36
@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-236 August 4, 2026 18:36 Destroyed
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@aspiers
aspiers merged commit 02c2d5e into main Aug 4, 2026
25 checks passed
@aspiers
aspiers deleted the fix/send-new-code-label branch August 4, 2026 18:53
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.

2 participants