feat(signup): Continue as… account chooser on auth open - #176
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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_pendingcan be offered when there is pending register state but the wizard is opened inmode === "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 isregisterand the current mode islogin.
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resume=1, mid-setup reload, and Checkout return URLs; GATE-01 provisionable gate unchangedTest plan
billing=plan-cancelstill lands on Pay without chooser