Skip to content

fix(auth): gate email sign-in until its handlers are installed - #242

Merged
aspiers merged 1 commit into
mainfrom
split148/login-page-readiness
Aug 6, 2026
Merged

fix(auth): gate email sign-in until its handlers are installed#242
aspiers merged 1 commit into
mainfrom
split148/login-page-readiness

Conversation

@aspiers

@aspiers aspiers commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Split 2 of 4 from #148. Independent of the other three — based directly on main, mergeable in any order.

The bug

The Continue button on the email sign-in form was clickable from first paint, but its submit handler is installed at the end of a long inline script. A click landing in that window did nothing at all: the form had no handler yet, so the sign-in attempt was silently dropped.

Fast e2e runs hit this routinely. Real users on slow connections can too.

The fix

Ship the button disabled and enable it as the last step of handler setup, so it becomes clickable exactly when it starts working.

Also adds a <noscript> warning: with scripting off the button would otherwise never respond and never explain why.

Tests

The tests pin the ordering rather than the mechanism — the enable must follow the submit binding, and must not be driven by a setTimeout/setInterval. Anchoring on a timer would pass for the wrong reason, and the page legitimately uses setInterval elsewhere for the PAR heartbeat, so the timer check is scoped to the gap between binding and enable.

Verification

typecheck, lint, format clean; 73 test files / 1124 tests pass.

Series

  1. refactor(pds-core): extract OAuth client-id resolution from CSS middleware #241 — extract OAuth client-id resolution
  2. fix(auth): gate email sign-in until its handlers are installed #242 ← this PR — gate email sign-in until handlers are installed
  3. feat(auth): sign epds_handle_mode through the callback hop #243 — sign epds_handle_mode through the callback hop
  4. fix(pds-core): identify generated-handle accounts by email #244 — identify generated-handle accounts by email

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 5, 2026 17:09
@vercel

vercel Bot commented Aug 5, 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 6, 2026 9:17am

Request Review

@changeset-bot

changeset-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a0a819a

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

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 59 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: 225f03e9-4c10-45ee-8598-0434692a1bb7

📥 Commits

Reviewing files that changed from the base of the PR and between 2b10346 and a0a819a.

📒 Files selected for processing (3)
  • .changeset/sign-in-button-readiness.md
  • packages/auth-service/src/__tests__/login-page.test.ts
  • packages/auth-service/src/routes/login-page.ts

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.

@railway-app

railway-app Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

Service Status Web Updated (UTC)
@certified-app/auth-service ✅ Success (View Logs) Web Aug 6, 2026 at 9:17 am
@certified-app/demo untrusted ✅ Success (View Logs) Web Aug 5, 2026 at 5:11 pm
@certified-app/pds-core ✅ Success (View Logs) Web Aug 5, 2026 at 5:11 pm
@certified-app/demo ✅ Success (View Logs) Web Aug 5, 2026 at 5:11 pm

@coveralls-official

coveralls-official Bot commented Aug 5, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 31088415828

Coverage remained the same at 58.051%

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: 3110
Covered Lines: 1793
Line Coverage: 57.65%
Relevant Branches: 1939
Covered Branches: 1138
Branch Coverage: 58.69%
Branches in Coverage %: Yes
Coverage Strength: 9.82 hits per line

💛 - Coveralls

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 fixes a race on the auth-service login page where the email “Continue” button could be clicked before its JS submit handler was installed, causing the sign-in attempt to be silently dropped. It does this by disabling the submit button in the initial HTML and only enabling it after handler setup completes, and it adds coverage to lock in the ordering.

Changes:

  • Render the email OTP submit button as disabled on first paint and enable it only after installing the form submit handler.
  • Add a <noscript> warning so users without JavaScript get an explicit explanation instead of a non-responsive flow.
  • Add unit tests that assert enablement happens after handler binding and that readiness is not driven by a timer.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/auth-service/src/routes/login-page.ts Disables the email submit button in HTML, binds the submit handler via a stored form ref, then enables the button after handler setup; adds a noscript warning.
packages/auth-service/src/__tests__/login-page.test.ts Adds tests that pin the “bind submit handler → enable button” ordering and ensure no timer-based readiness in that region.
.changeset/sign-in-button-readiness.md Adds end-user-facing patch release notes describing the behavior change and the noscript experience.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The Continue button was clickable from first paint, but its submit
handler is installed at the end of a long inline script. A click
landing in that window did nothing: the form had no handler yet, so
the sign-in attempt was silently dropped. Fast e2e runs hit this
routinely; real users on slow connections can too.

Ship the button disabled and enable it as the last step of handler
setup, so it becomes clickable exactly when it starts working. Add a
noscript warning as well, since with scripting off the button would
otherwise never respond and never explain why.

The tests pin the ordering rather than the mechanism: the enable must
follow the submit binding, and must not be driven by a timer.

Split out of #148, which bundled this with unrelated enrichment work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aspiers
aspiers force-pushed the split148/login-page-readiness branch from b14ed8a to a0a819a Compare August 6, 2026 09:16
@railway-app
railway-app Bot temporarily deployed to ePDS / ePDS-pr-242 August 6, 2026 09:16 Destroyed
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@aspiers
aspiers merged commit d1b71a8 into main Aug 6, 2026
24 checks passed
@aspiers
aspiers deleted the split148/login-page-readiness branch August 6, 2026 09:42
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