diff --git a/example/e2e/invoice-schedule.spec.ts b/example/e2e/invoice-schedule.spec.ts index 751f5a4f2..ac8f67ef2 100644 --- a/example/e2e/invoice-schedule.spec.ts +++ b/example/e2e/invoice-schedule.spec.ts @@ -37,12 +37,6 @@ const currenciesResponse = { * reverse registration order, so the specific stubs below take precedence over it. */ async function stubInvoiceScheduleApi(page: Page) { - await page.route('**/api/fetch-refresh-token', (route) => - route.fulfill({ - json: { access_token: 'e2e-access-token', expires_in: 3600 }, - }), - ); - await page.route( /\/v1\/contractors\/employments\/[^/]+\/contractor-currencies/, (route) => route.fulfill({ json: currenciesResponse }), diff --git a/example/src/ContractorOnboarding.tsx b/example/src/ContractorOnboarding.tsx index 2443a4083..f3248f826 100644 --- a/example/src/ContractorOnboarding.tsx +++ b/example/src/ContractorOnboarding.tsx @@ -745,10 +745,7 @@ export const ContractorOnboardingWithProps = ({ }: ContractorOnboardingFormData) => { return (
- +
{ return (
- +
diff --git a/example/src/JsonSchemaComparisonDemo.tsx b/example/src/JsonSchemaComparisonDemo.tsx index 79e472354..149394158 100644 --- a/example/src/JsonSchemaComparisonDemo.tsx +++ b/example/src/JsonSchemaComparisonDemo.tsx @@ -3,10 +3,7 @@ import { RemoteFlows } from './RemoteFlows'; export const JsonSchemaComparisonDemo = () => { return ( - + ); diff --git a/example/src/RemoteFlows.tsx b/example/src/RemoteFlows.tsx index 83820f7ff..10445a725 100644 --- a/example/src/RemoteFlows.tsx +++ b/example/src/RemoteFlows.tsx @@ -47,8 +47,9 @@ type RemoteFlowsProps = Omit & { auth?: RemoteFlowsSDKProps['auth']; isClientToken?: boolean; /** - * `'none'` skips the FE-side auth callback entirely — use it when the proxy - * mints tokens server-side and the FE never needs to hold one. + * `'none'` skips the FE-side auth callback entirely. It's the default when + * `proxy` is passed, since the example proxy mints tokens server-side and + * the FE never needs to hold one. */ authType?: 'refresh-token' | 'company-manager' | 'client' | 'none'; }; @@ -59,8 +60,9 @@ export const RemoteFlows = ({ authType, ...props }: RemoteFlowsProps) => { + const hasProxy = !!props.proxy; const auth = useMemo(() => { - if (authType === 'none') { + if (authType === 'none' || (!authType && !isClientToken && hasProxy)) { return undefined; } if (authType === 'company-manager') { @@ -71,7 +73,7 @@ export const RemoteFlows = ({ } return fetchCompanyToken; - }, [authType, isClientToken]); + }, [authType, isClientToken, hasProxy]); return ( { const proxyURL = window.location.origin; return ( - + { }, []); return ( - +