Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
Fix onboarding flashes and completion for licensed users (#7559)
teo6b61bfaa9e10
diff --git a/apps/web/src/features/auth/auth.tsx b/apps/web/src/features/auth/auth.tsxindex 1b1567c31e..add1912767 100644--- a/apps/web/src/features/auth/auth.tsx+++ b/apps/web/src/features/auth/auth.tsx@@ -52,7 +52,7 @@ export function Login(props: { signupMode?: boolean }) {onSignIn={() => navigate('/login')}// Desktop sign-up resolves into onboarding's frame either way.pending={desktopSignup() ? () => <OnboardingPending /> : undefined}- signedIn={(user) => <PostAuthGate user={user} />}+ signedIn={(user) => <PostAuthGate user={user()} />}/></AuthProvider>);diff --git a/apps/web/src/features/auth/browser-test/fixture.tsx b/apps/web/src/features/auth/browser-test/fixture.tsxindex 94d2ded525..0ae04eee0a 100644--- a/apps/web/src/features/auth/browser-test/fixture.tsx+++ b/apps/web/src/features/auth/browser-test/fixture.tsx@@ -180,7 +180,7 @@ function Fixture() {pending={page === 'signup' ? () => <OnboardingPendingView /> : undefined}- signedIn={(user) => <SignedIn user={user} />}+ signedIn={(user) => <SignedIn user={user()} />}/></Match></Switch>diff --git a/apps/web/src/features/auth/views/auth-view.test.tsx b/apps/web/src/features/auth/views/auth-view.test.tsxindex a9e091699c..deb780d2e1 100644--- a/apps/web/src/features/auth/views/auth-view.test.tsx+++ b/apps/web/src/features/auth/views/auth-view.test.tsx@@ -36,7 +36,7 @@ function setup(signupJourney={options.signupJourney}signedIn={(user) => (<p data-testid="signed-in">- {user.email} {user.tutorialComplete ? 'returning' : 'new'}+ {user().email} {user().tutorialComplete ? 'returning' : 'new'}</p>)}/>@@ -59,6 +59,38 @@ const typeCode = async (value: string) =>});describe('email sign-in', () => {+ it('updates a signed-in viewer without remounting their workspace on session refresh', () => {+ const { fake } = setup({+ world: {+ user: {+ id: 'macro|[email protected]',+ email: '[email protected]',+ tutorialComplete: false,+ },+ },+ });+ const workspace = screen.getByTestId('signed-in');++ fake.update((draft) => {+ if (draft.user) draft.user.tutorialComplete = true;+ });++ expect(screen.getByTestId('signed-in')).toBe(workspace);+ expect(workspace.textContent).toBe('[email protected] returning');++ fake.update((draft) => {+ draft.user = {+ id: 'macro|[email protected]',+ email: '[email protected]',+ tutorialComplete: false,+ };+ });+ expect(screen.getByTestId('signed-in')).not.toBe(workspace);+ expect(screen.getByTestId('signed-in').textContent).toBe(+ '[email protected] new'+ );+ });+it('sends a code, verifies it, and hands off to the signed-in view', async () => {const { fake, verified } = setup();click('Continue with email');diff --git a/apps/web/src/features/auth/views/auth-view.tsx b/apps/web/src/features/auth/views/auth-view.tsxindex c65ca1a9c4..bfa2a3d1e8 100644--- a/apps/web/src/features/auth/views/auth-view.tsx+++ b/apps/web/src/features/auth/views/auth-view.tsx@@ -1,5 +1,12 @@import { Stepper } from '@ui/components/Stepper';-import { type JSX, Match, onMount, Show, Switch } from 'solid-js';+import {+ type Accessor,+ type JSX,+ Match,+ onMount,+ Show,+ Switch,+} from 'solid-js';import { EmailForm } from '../components/email-form';import { LoginCard } from '../components/login-card';import { LoginPicker } from '../components/login-picker';@@ -45,7 +52,7 @@ export function AuthView(props: {*/pending?: () => JSX.Element;/** What a signed-in visitor sees instead. */- signedIn: (user: AuthUser) => JSX.Element;+ signedIn: (user: Accessor<AuthUser>) => JSX.Element;}) {const context = useAuthContext();const login = createEmailLogin(context, {@@ -118,8 +125,14 @@ export function AuthView(props: {return (<Show when={context.session().t !== 'loading'} fallback={props.pending?.()}>- <Show when={user()} keyed fallback={signedOut()}>- {(signedIn) => props.signedIn(signedIn)}+ <Show when={user()} fallback={signedOut()}>+ {(signedIn) => (+ // Refreshes update the existing workspace; only changing accounts+ // should remount it and restart its pending work.+ <Show when={signedIn().id} keyed>+ {(_id) => props.signedIn(signedIn)}+ </Show>+ )}</Show></Show>);diff --git a/apps/web/src/features/onboarding/components/team-panels.tsx b/apps/web/src/features/onboarding/components/team-panels.tsxindex 4e514bc53b..2b5dd3b8dd 100644--- a/apps/web/src/features/onboarding/components/team-panels.tsx+++ b/apps/web/src/features/onboarding/components/team-panels.tsx@@ -5,7 +5,11 @@ import type { TeamInvite } from '../context/onboarding-context';import { ContinueButton, SkipButton } from './controls';/** Already on a team — auto-joined by domain, or just created/joined here. */-export function OnTeamPanel(props: { name: string; onContinue: () => void }) {+export function OnTeamPanel(props: {+ name: string;+ finishing: boolean;+ onContinue: () => void;+}) {return (<div class="flex flex-col gap-3"><div class="flex flex-col items-center gap-2 py-4 text-center">@@ -20,7 +24,11 @@ export function OnTeamPanel(props: { name: string; onContinue: () => void }) {shared with you.</p></div>- <ContinueButton onClick={props.onContinue} />+ <ContinueButton+ label={props.finishing ? 'Opening your workspace…' : 'Continue'}+ disabled={props.finishing}+ onClick={props.onContinue}+ /></div>);}@@ -52,7 +60,7 @@ export function InvitesPanel(props: {</div>)}</For>- <SkipButton onClick={props.onSkip} />+ <SkipButton disabled={props.joining} onClick={props.onSkip} /></div>);}diff --git a/apps/web/src/features/onboarding/create-app-onboarding-context.ts b/apps/web/src/features/onboarding/create-app-onboarding-context.tsindex 8deebe5648..6f596bc438 100644--- a/apps/web/src/features/onboarding/create-app-onboarding-context.ts+++ b/apps/web/src/features/onboarding/create-app-onboarding-context.ts@@ -9,10 +9,8 @@ import {} from '@core/pipedream/catalog';import { idToDisplayName, idToEmail } from '@core/user/util';import { useCreateCheckoutSessionMutation } from '@queries/auth';-import { authKeys } from '@queries/auth/keys';import { useCompleteTutorialMutation } from '@queries/auth/tutorial';import { type UserInfoData, useUserInfoQuery } from '@queries/auth/user-info';-import { queryClient } from '@queries/client';import { useContactsQuery } from '@queries/contacts/contacts';import { invalidateEmailLinks, useEmailLinksQuery } from '@queries/email/link';import { useGithubStarsQuery } from '@queries/github-stars';@@ -100,11 +98,6 @@ export function createAppOnboardingContext(): OnboardingContext {const state = viewer();return state.t === 'signed-in' && !state.viewer.tutorialComplete;};- const refetchViewer = () =>- queryClient- .refetchQueries({ queryKey: authKeys.userInfo.queryKey })- .catch(() => {});-return {viewer,refreshViewer: async () => {@@ -214,27 +207,15 @@ export function createAppOnboardingContext(): OnboardingContext {)),completeOnboarding: async ({ skipped }) => {- const [onboardingResult] = await Promise.allSettled([- completeOnboarding.mutateAsync({ skipped }),- completeTutorial.mutateAsync(),- ]);- // Exiting with the row still active would leave staged candidates- // undiscarded and the flow resumable after the user thinks it's done.- if (onboardingResult.status === 'rejected') return { t: 'failed' };- // The Layout redirect keys off tutorialComplete, so leaving before the- // cache reflects the PATCH would bounce straight back. Read the cache,- // not the observer: its store flushes on a later task.- await refetchViewer();- const data = queryClient.getQueryData<UserInfoData>(- authKeys.userInfo.queryKey- );- return data?.tutorialComplete === true- ? { t: 'completed' }- : { t: 'failed' };+ // Finish the row before publishing tutorialComplete, which lets the+ // auth gate unmount onboarding. The tutorial mutation updates its cache+ // from the successful PATCH; a racing refetch isn't a completion check.+ await completeOnboarding.mutateAsync({ skipped });+ await completeTutorial.mutateAsync();+ return { t: 'completed' };},repairTutorial: async () => {await completeTutorial.mutateAsync();- await refetchViewer();},applyAccent: applyWorkspaceAccent,diff --git a/apps/web/src/features/onboarding/primitives/onboarding-flow.ts b/apps/web/src/features/onboarding/primitives/onboarding-flow.tsindex c159033633..0cdfae5a52 100644--- a/apps/web/src/features/onboarding/primitives/onboarding-flow.ts+++ b/apps/web/src/features/onboarding/primitives/onboarding-flow.ts@@ -117,6 +117,7 @@ export function createOnboardingFlow(const record = options.record();if (repairing ||+ options.finishing() ||!needsOnboarding() ||record.t !== 'ready' ||record.value.status !== 'completed'diff --git a/apps/web/src/features/onboarding/views/onboarding-flow-view.test.tsx b/apps/web/src/features/onboarding/views/onboarding-flow-view.test.tsxindex dadb4cb709..8b5c2a7c4d 100644--- a/apps/web/src/features/onboarding/views/onboarding-flow-view.test.tsx+++ b/apps/web/src/features/onboarding/views/onboarding-flow-view.test.tsx@@ -155,7 +155,7 @@ describe('onboarding flow', () => {checkoutReturn: { t: 'success', tier: 'premium' },world: { webhookPollsRemaining: 1 },});- await heading('Free Claude & GPT for 30 days.');+ await heading('Your workspace is ready.');await waitFor(() => expect(navigate).toHaveBeenCalledWith('/home'), {timeout: 3_000,});@@ -198,6 +198,104 @@ describe('onboarding flow', () => {});});+ it('finishes for a licensed team member without showing trial or Guest offers', async () => {+ const { navigate, redirect } = setup({+ resume: 'plan',+ world: {+ teams: [{ name: 'Acme' }],+ viewer: {+ id: FAKE_VIEWER_ID,+ email: '[email protected]',+ tutorialComplete: false,+ licensed: true,+ },+ },+ });+ await heading('Your workspace is ready.');+ expect(+ screen.queryByRole('button', { name: 'Start 30 day trial' })+ ).toBeNull();+ expect(screen.queryByRole('table')).toBeNull();+ expect(+ screen.queryByRole('button', { name: 'Continue as Guest' })+ ).toBeNull();+ await waitFor(() =>+ expect(navigate).toHaveBeenCalledExactlyOnceWith('/home')+ );+ expect(redirect).not.toHaveBeenCalled();+ });++ it('finishes a licensed member directly on the team step while saving', async () => {+ const { fake, navigate } = setup({+ resume: 'team',+ world: {+ teams: [{ name: 'Acme' }],+ viewer: {+ id: FAKE_VIEWER_ID,+ email: '[email protected]',+ tutorialComplete: false,+ licensed: true,+ },+ },+ });+ const completion = Promise.withResolvers<{ t: 'completed' }>();+ const save = vi+ .spyOn(fake.context, 'completeOnboarding')+ .mockReturnValue(completion.promise);+ await heading('Built for teams.');+ click('Continue');++ const opening = await screen.findByRole('button', {+ name: 'Opening your workspace…',+ });+ expect(opening.hasAttribute('disabled')).toBe(true);+ expect(+ screen.getByRole('heading', { name: 'Built for teams.' })+ ).toBeTruthy();+ expect(screen.queryByText('Your workspace is ready.')).toBeNull();+ expect(readSavedStep(FAKE_VIEWER_ID)).toBe('team');+ expect(save).toHaveBeenCalledOnce();+ expect(navigate).not.toHaveBeenCalled();++ completion.resolve({ t: 'completed' });+ await waitFor(() =>+ expect(navigate).toHaveBeenCalledExactlyOnceWith('/home')+ );+ });++ it('lets a licensed member retry a failed save from the team step', async () => {+ const { fake, navigate } = setup({+ resume: 'team',+ world: {+ teams: [{ name: 'Acme' }],+ viewer: {+ id: FAKE_VIEWER_ID,+ email: '[email protected]',+ tutorialComplete: false,+ licensed: true,+ },+ failures: { completion: 'Save failed' },+ },+ });+ await heading('Built for teams.');+ click('Continue');+ await waitFor(() => expect(fake.notifications()).toHaveLength(1));+ expect(+ screen.getByRole('heading', { name: 'Built for teams.' })+ ).toBeTruthy();+ expect(+ screen.getByRole('button', { name: 'Continue' }).hasAttribute('disabled')+ ).toBe(false);+ expect(navigate).not.toHaveBeenCalled();+ fake.update((world) => {+ delete world.failures.completion;+ });+ click('Continue');+ await waitFor(() =>+ expect(navigate).toHaveBeenCalledExactlyOnceWith('/home')+ );+ });+it('sends a signed-out visitor to sign in', async () => {const { signedOut } = setup({ world: { viewer: null } });await waitFor(() => expect(signedOut).toHaveBeenCalled());diff --git a/apps/web/src/features/onboarding/views/onboarding-flow-view.tsx b/apps/web/src/features/onboarding/views/onboarding-flow-view.tsxindex c3fe78ed3d..293eca4cf7 100644--- a/apps/web/src/features/onboarding/views/onboarding-flow-view.tsx+++ b/apps/web/src/features/onboarding/views/onboarding-flow-view.tsx@@ -95,12 +95,33 @@ export function OnboardingFlowView(props: {queueMicrotask(() => focusStepHeading(content));});};- const advance = (outcome: StepOutcome = 'completed') =>- goTo(flow.leave(outcome));+ const advance = (outcome: StepOutcome = 'completed') => {+ if (finish.finishing()) return;+ const next = flow.leave(outcome);+ const viewer = context.viewer();+ if (+ step() === 'team' &&+ viewer.t === 'signed-in' &&+ viewer.viewer.licensed+ ) {+ void finish.finishPremium();+ return;+ }+ goTo(next);+ };const viewerEmail = () => {const viewer = context.viewer();return viewer.t === 'signed-in' ? viewer.viewer.email : undefined;};+ const showPlanOffer = () => {+ const viewer = context.viewer();+ return (+ step() === 'plan' &&+ props.checkoutReturn?.t !== 'success' &&+ viewer.t === 'signed-in' &&+ !viewer.viewer.licensed+ );+ };const back = () => {const current = step();const previous = current && previousOnboardingStep(current);@@ -121,9 +142,9 @@ export function OnboardingFlowView(props: {)}</Show>}- explainerLabel={step() === 'plan' ? 'Continue as Guest' : undefined}+ explainerLabel={showPlanOffer() ? 'Continue as Guest' : undefined}explainer={- step() === 'plan' ? (+ showPlanOffer() ? (<PlanComparisondisabled={finish.finishing()}onContinueGuest={() => void finish.finishFree()}@@ -165,6 +186,7 @@ export function OnboardingFlowView(props: {</Match><Match when={step() === 'team'}><TeamStep+ finishing={finish.finishing()}onContinue={() => advance()}onSkip={() => advance('skipped')}/>diff --git a/apps/web/src/features/onboarding/views/plan-step.test.tsx b/apps/web/src/features/onboarding/views/plan-step.test.tsxindex 71376ab5bf..3121bd91bb 100644--- a/apps/web/src/features/onboarding/views/plan-step.test.tsx+++ b/apps/web/src/features/onboarding/views/plan-step.test.tsx@@ -93,6 +93,12 @@ describe('live trial checkout', () => {licensed: true,},});+ expect(+ screen.queryByRole('heading', { name: 'Free Claude & GPT for 30 days.' })+ ).toBeNull();+ expect(+ screen.getByRole('heading', { name: 'Your workspace is ready.' })+ ).toBeTruthy();await waitFor(() => expect(finish).toHaveBeenCalledWith('premium'));expect(checkout).not.toHaveBeenCalled();});diff --git a/apps/web/src/features/onboarding/views/plan-step.tsx b/apps/web/src/features/onboarding/views/plan-step.tsxindex d3f576a3c6..6a3f87f8b2 100644--- a/apps/web/src/features/onboarding/views/plan-step.tsx+++ b/apps/web/src/features/onboarding/views/plan-step.tsx@@ -49,11 +49,14 @@ export function PlanStep(props: {tabindex="-1"class="font-[Roboto_Slab_Variable] text-[clamp(1.75rem,8vw,3rem)] font-[315] leading-[1.12] tracking-tight outline-none text-balance">- Free Claude & GPT for 30 days.+ {plan.state().t === 'offer'+ ? 'Free Claude & GPT for 30 days.'+ : 'Your workspace is ready.'}</h1><p class="mx-auto mt-6 max-w-[400px] text-sm leading-6 text-ink-muted text-balance sm:text-[15px]">- Every feature, every AI model and 1 TB of storage. Your first 30 days- are on us, then $40/user/month.+ {plan.state().t === 'offer'+ ? 'Every feature, every AI model and 1 TB of storage. Your first 30 days are on us, then $40/user/month.'+ : "We're confirming your access so you can continue to your workspace."}</p></header><Showdiff --git a/apps/web/src/features/onboarding/views/team-step.tsx b/apps/web/src/features/onboarding/views/team-step.tsxindex e3217fcaaf..e9c4ba8ac7 100644--- a/apps/web/src/features/onboarding/views/team-step.tsx+++ b/apps/web/src/features/onboarding/views/team-step.tsx@@ -19,6 +19,7 @@ import {* join, otherwise create (with a domain-derived name and same-domain* teammates pre-added to the invite list). */export function TeamStep(props: {+ finishing: boolean;onContinue: () => void;onSkip: () => void;}) {@@ -49,13 +50,19 @@ export function TeamStep(props: {<TeamStatus message="Loading your team…" /></Match><Match when={onTeam(team.state())} keyed>- {(name) => <OnTeamPanel name={name} onContinue={props.onContinue} />}+ {(name) => (+ <OnTeamPanel+ name={name}+ finishing={props.finishing}+ onContinue={props.onContinue}+ />+ )}</Match><Match when={pendingInvites(team.state())}>{(invites) => (<InvitesPanelinvites={invites()}- joining={team.joining()}+ joining={team.joining() || props.finishing}onJoin={(id) => void team.join(id)}onSkip={props.onSkip}/>@@ -69,6 +76,7 @@ export function TeamStep(props: {>{(ready) => (<TeamForm+ finishing={props.finishing}seed={ready}ownEmail={ownEmail()}onContinue={props.onContinue}@@ -91,6 +99,7 @@ const pendingInvites = () => (state.t === 'invites' ? state.invites : undefined);function TeamForm(props: {+ finishing: boolean;seed: TeamFormSeed;ownEmail: string | undefined;onContinue: () => void;@@ -107,7 +116,7 @@ function TeamForm(props: {id="team"name={form.name()}emails={form.slots()}- disabled={form.pending()}+ disabled={form.pending() || props.finishing}suggested={form.suggested}onNameChange={form.setName}onEmailChange={form.setSlot}@@ -116,16 +125,21 @@ function TeamForm(props: {/><ContinueButtonlabel={- form.pending()- ? 'Creating workspace…'- : form.invites().length > 0- ? `Create team & invite ${form.invites().length}`- : 'Create team'+ props.finishing+ ? 'Opening your workspace…'+ : form.pending()+ ? 'Creating workspace…'+ : form.invites().length > 0+ ? `Create team & invite ${form.invites().length}`+ : 'Create team'}- disabled={!form.canCreate()}+ disabled={!form.canCreate() || props.finishing}onClick={() => void form.create()}/>- <SkipButton disabled={form.pending()} onClick={props.onSkip} />+ <SkipButton+ disabled={form.pending() || props.finishing}+ onClick={props.onSkip}+ /></div>);}diff --git a/apps/web/src/lib/queries/auth/tutorial.ts b/apps/web/src/lib/queries/auth/tutorial.tsindex 9ded27d8f4..c2fea1199f 100644--- a/apps/web/src/lib/queries/auth/tutorial.ts+++ b/apps/web/src/lib/queries/auth/tutorial.ts@@ -4,8 +4,15 @@ import { useMutation } from '@tanstack/solid-query';import { queryClient } from '../client';import { type MutationCallbacks, withCallbacks } from '../utils';import { authKeys } from './keys';+import type { UserInfoData } from './user-info';-type CompleteTutorialCallbacks = MutationCallbacks<void, Error, void>;+type TutorialContext = { userId: string | undefined };+type CompleteTutorialCallbacks = MutationCallbacks<+ void,+ Error,+ void,+ TutorialContext+>;export function useCompleteTutorialMutation(callbacks?: CompleteTutorialCallbacks@@ -17,12 +24,27 @@ export function useCompleteTutorialMutation(await authServiceClient.patchUserTutorial({ tutorialComplete: true }));},- ...withCallbacks<void, Error, void>(+ ...withCallbacks<void, Error, void, TutorialContext>({- onSuccess: () => {- queryClient.invalidateQueries({+ onMutate: () => ({+ userId: queryClient.getQueryData<UserInfoData>(+ authKeys.userInfo.queryKey+ )?.userId,+ }),+ onSuccess: async (_data, _variables, context) => {+ if (!context?.userId) return;+ // The PATCH confirms this value. Stop older reads from replacing it+ // before publishing it to the auth gate that ends onboarding.+ await queryClient.cancelQueries({queryKey: authKeys.userInfo.queryKey,});+ queryClient.setQueryData<UserInfoData>(+ authKeys.userInfo.queryKey,+ (user) =>+ user && user.userId === context.userId+ ? { ...user, tutorialComplete: true }+ : user+ );},},callbacksdiff --git a/apps/web/src/lib/queries/auth/user-info.ts b/apps/web/src/lib/queries/auth/user-info.tsindex 25886d6f7b..f3d754f312 100644--- a/apps/web/src/lib/queries/auth/user-info.ts+++ b/apps/web/src/lib/queries/auth/user-info.ts@@ -37,6 +37,10 @@ export function useUserInfoQuery(options?: UseUserInfoQueryOptions) {),throwOnError: false,staleTime: USER_INFO_STALE_TIME,+ // Signed-out screens also observe this query. Retrying their cached 401+ // on mount resets auth to loading, unmounts them, and repeats forever.+ // Successful login explicitly invalidates the query to refresh identity.+ retryOnMount: false,// Never pause on navigator.onLine — it reports false during native cold// launches (e.g. woken by a notification tap) while the network is fine,// and a paused auth check renders as "unauthenticated" at the base path.diff --git a/docs/AGENT_GUIDE/login.md b/docs/AGENT_GUIDE/login.mdindex b06aa9b2a7..9ea4772b82 100644--- a/docs/AGENT_GUIDE/login.md+++ b/docs/AGENT_GUIDE/login.md@@ -94,7 +94,10 @@ New desktop users enter the same flow fromopen `/app/signup`. Existing members and native mobile keep their existing routes.Signed-out `/app/signup` starts at the workspace color picker, followed by feature-interests and security. No account is required for these slides. Below the color+interests and security. No account is required for these slides. The signed-out+page should remain stable after the session check returns+401; it must not alternate with the loading screen or reset a selected color.+Verify that Continue advances without signing in. Below the colorpicker, "Already have an account? Sign in instead" opens `/app/login`. At the work-emailstep, Connect work email uses Google sign-up to create the Macro account and linkthe primary inbox. This step offers Google sign-up only, with no alternate email@@ -116,6 +119,18 @@ more, cancel/retry connection, and confirm connected checks persist on return.Team setup retains existing membership, invite acceptance, domain suggestions,and editable invite recipients; submitting the form sends real invitations.+Members with an active or trialing license, including a license from their team,+finish directly from the team step without visiting the plan page. The Continue+button reads "Opening your workspace…" while saving; a failed save leaves the+team step available to retry. Checkout returns still use the plan step to confirm+payment. Session refreshes must preserve the mounted onboarding flow so+completion finishes instead of repeatedly flashing or restarting.++Finishing setup saves the onboarding record before marking the tutorial complete.+The confirmed tutorial save updates the session cache before leaving. A successful+finish must not show "Couldn't finish setup — please try again", including when+a background session refresh overlaps it.+The trial offer contains no card fields or wallet buttons. Its primary buttonrequests an automatic 30-day Premium trial through Stripe Checkout; no couponcode is required. Stripe collects the payment method for billing after the trial.