Skip to content

Commit 562a37b

Browse files
gnick18claude
andcommitted
fix(lab): drop the up-front Stripe card redirect at lab creation (no-card-up-front)
The Start-a-lab cold-signup door redirected a freshly provisioned PI to hosted Stripe Checkout for a card-on-file. That (1) contradicted the no-card-up-front decision and (2) the full external redirect dropped the local folder read-write permission, so the return landed the user back at the folder picker with no confirmation and no active session. Now the lab head lands straight in the app as a provisioned lab head; the card is captured later via the upgrade nudge + settings billing panel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3e252a4 commit 562a37b

1 file changed

Lines changed: 11 additions & 22 deletions

File tree

frontend/src/components/lab/LabCreateResume.tsx

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,15 @@ export default function LabCreateResume() {
213213
[currentUser],
214214
);
215215

216-
// Cold paid-signup door (Billing handoff). When the chooser's paid "Start a lab"
217-
// CTA set the start-plan marker, send the freshly provisioned PI to the Stripe
218-
// card-on-file checkout so a user who chose paid up front saves a card instead of
219-
// landing as a free signed-in lab head. Runs once the lab + PI are provisioned
220-
// (done). Best-effort and billing-flag-gated server side: a non-ok response
221-
// (billing off, not ready) leaves them a provisioned free lab head, and the
222-
// in-app upgrade nudge + settings panel still convert them later. Only the "lab"
223-
// marker is ours, a future Solo door redirects from its own provisioning path.
216+
// Paid "Start a lab" landing (NO-CARD-UP-FRONT, Grant 2026-06-17). The chooser's
217+
// paid CTA sets the start-plan marker; we consume it once the lab + PI are
218+
// provisioned, but DO NOT collect a card here. Per the no-card-up-front decision
219+
// the lab head lands straight in the app as a provisioned lab head, and the card
220+
// is captured later at the conversion moment (the in-app upgrade nudge + the
221+
// settings billing panel). The old up-front Stripe card-on-file redirect was
222+
// removed, it forced a card at signup AND its full external redirect to hosted
223+
// Checkout dropped the local folder's read-write permission, dumping the user
224+
// back at the folder picker with no confirmation on return.
224225
useEffect(() => {
225226
if (!done) return;
226227
let plan: string | null = null;
@@ -230,25 +231,13 @@ export default function LabCreateResume() {
230231
// sessionStorage unavailable; nothing to do.
231232
}
232233
if (plan !== "lab") return;
234+
// Consume the marker so it does not linger. No Stripe redirect, the lab head
235+
// simply lands in the app (no-card-up-front).
233236
try {
234237
sessionStorage.removeItem("researchos:start-plan");
235238
} catch {
236239
// best-effort consume.
237240
}
238-
void (async () => {
239-
try {
240-
const res = await fetch("/api/billing/model-a/card-setup", {
241-
method: "POST",
242-
headers: { "content-type": "application/json" },
243-
body: JSON.stringify({ planId: "lab" }),
244-
});
245-
if (!res.ok) return;
246-
const data = (await res.json()) as { url?: string };
247-
if (data.url) window.location.assign(data.url);
248-
} catch {
249-
// best-effort: stay a provisioned free lab head, the nudge converts later.
250-
}
251-
})();
252241
}, [done]);
253242

254243
useEffect(() => {

0 commit comments

Comments
 (0)