Skip to content

fix(web): stop sign-in with an email code from landing back on /signin - #14704

Open
dylanjeffers wants to merge 1 commit into
mainfrom
fix/signin-stuck
Open

dylanjeffers wants to merge 1 commit into
mainfrom
fix/signin-stuck

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Problem

After a sign-in that needed an email code, the user was signed in but stayed on the sign-in form until they clicked the X. The sign-up "Welcome to Audius!" modal also opened over it.

Sequence, from a recorder on a real sign-in (ms):

  1. Code accepted, SIGN_IN_SUCCEEDED. SignOnPage renders <Navigate to="/feed"> (push at 109422). React holds that navigation while lazy FeedPage loads, so the sign-on tree stays mounted.
  2. Account loads, and the saga calls resetSignOn, which sets status back to editing (109833).
  3. The still-mounted SignOnPage renders the form again, which remounts SignInRootPage. Its first-mount rule turns /signin/confirm-email into <Navigate to="/signin" replace> (replace at 109838), which cancels the pending /feed navigation.

It needs the email-code step (at plain /signin the remount shows SignInPage and doesn't redirect) and a /feed render slower than the account fetch. That's most likely on a cold cache, like a tab opened straight to /signin.

The welcome modal: ConfirmEmailPage dispatched startSignUp() on every submit. Since #14131 that flag opens the Welcome modal in SignOnPage.

Fix

  • SignOnPage keeps rendering the completion <Navigate> once sign-on has succeeded, so a status reset can't bring the form back mid-navigation.
  • ConfirmEmailPage only dispatches startSignUp() for guests, who finish sign-up from there. The incomplete-account resume paths in the sign-in saga already set startedSignUpProcess through openSignOn.

Test plan

  • Repro on origin/main: direct /signin, email + code → /feed, then replaced to /signin. Signed in, form and welcome modal shown.
  • Same flow with this branch → stays on /feed, no welcome modal.
  • eslint on changed files, web tsc --noEmit
  • Guest checkout → confirm email → finish sign-up still works

🤖 Generated with Claude Code

After a sign-in that needed an email code, the sign-on saga resets the
form status right after success. The navigation to the completion route
is often still pending at that point (it suspends on lazy pages), so the
sign-on page rendered the form again. That remounted the sign-in routes,
whose first-mount redirect from /signin/confirm-email to /signin
cancelled the navigation. The user was signed in but left on the form.

Keep redirecting once sign-on has succeeded. Also stop the email code
page from marking a plain sign-in as a sign-up, which opened the
sign-up welcome modal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6cf2ffb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant