Skip to content

feat(signup): Continue as… account chooser on auth open - #176

Merged
lukedanielchapman merged 1 commit into
mainfrom
feat/signup-chooser-01
Aug 2, 2026
Merged

feat(signup): Continue as… account chooser on auth open#176
lukedanielchapman merged 1 commit into
mainfrom
feat/signup-chooser-01

Conversation

@lukedanielchapman

Copy link
Copy Markdown
Contributor

Summary

  • Show Continue as… when Create account / Log in opens with a Supabase session or unfinished pending signup (SIGNUP-CHOOSER-01)
  • Actions: complete signup / continue, or use a different account (fail-closed sign-out + clear local signup state)
  • Bypass chooser for resume=1, mid-setup reload, and Checkout return URLs; GATE-01 provisionable gate unchanged

Test plan

  • vitest accountChooser + authGate + authSteps + hostedAccount.bootstrap (25 passed)
  • Hard-refresh Create account with leftover unpaid session → Continue as… (not silent Pay)
  • Use a different account → Type step; new email used at Checkout
  • Complete signup → Pay for signed-in email
  • billing=plan-cancel still lands on Pay without chooser

Stop silent jump to Pay on register open. Let users complete signup for
the signed-in email or switch accounts (sign out + clear pending) so
Stripe Checkout matches their intent.
Copilot AI review requested due to automatic review settings August 2, 2026 18:12
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
atom-registry Ready Ready Preview Aug 2, 2026 6:12pm

Request Review

@lukedanielchapman
lukedanielchapman merged commit 5b83b2f into main Aug 2, 2026
4 checks passed

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

Adds a “Continue as…” account-chooser overlay to the hosted Supabase auth wizard so that opening Create account / Log in with an existing Supabase session and/or pending signup state prompts the user to continue, complete signup/payment, or switch accounts (with fail-closed sign-out + local-state clearing).

Changes:

  • Introduces chooser decision logic + actions (accountChooser.ts) and unit tests.
  • Integrates chooser flow into AuthWizard (new chooser phases, UI overlay, and action handling).
  • Adds Supabase helpers to read session email / email-confirmed state and styles for the chooser UI.

Reviewed changes

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

Show a summary per file
File Description
apps/shell/src/auth/hostedAccount.ts Adds helpers to read Supabase session email and email confirmation status.
apps/shell/src/auth/AuthWizard.tsx Integrates “Continue as…” chooser overlay and action handling into the auth wizard flow.
apps/shell/src/auth/auth-wizard.css Adds layout/styles for the chooser UI and actions.
apps/shell/src/auth/accountChooser.ts New module implementing chooser visibility, identity resolution, and action lists.
apps/shell/src/auth/accountChooser.test.ts Unit tests covering chooser logic and action matrix.
Suppressed comments (1)

apps/shell/src/auth/AuthWizard.tsx:749

  • resume_pending can be offered when there is pending register state but the wizard is opened in mode === "login" (pending-only chooser). In that case, the current handler routes to the login credentials flow, which will attempt to sign in rather than resume signup. Redirect to the register wizard when pending.kind is register and the current mode is login.
      if (actionId === "resume_pending") {
        applyPendingFromStorage();
        setChooserPhase("done");
        goTo(mode === "login" ? "credentials" : "credentials");
        return;

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

Comment on lines +466 to 472
if (billing === "plan-cancel" && (mode === "register" || mode === "login")) {
if (pending) restorePending(pending);
setHosting("hosted");
setChooserPhase("done");
goTo("pay");
setError("Payment cancelled — nothing was charged. Continue when you’re ready.");
return;
Comment on lines +36 to +41
export function emailsEqualIgnoreCase(a: string | null | undefined, b: string | null | undefined): boolean {
const left = (a ?? "").trim().toLowerCase();
const right = (b ?? "").trim().toLowerCase();
if (!left || !right) return left === right;
return left === right;
}
Comment on lines +526 to +530
try {
provisionable = await isHostedSubscriptionProvisionable();
} catch {
provisionable = null;
provisionCheckFailed = true;
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