diff --git a/.changeset/four-wombats-clean.md b/.changeset/four-wombats-clean.md new file mode 100644 index 00000000000..5eb78a1fa05 --- /dev/null +++ b/.changeset/four-wombats-clean.md @@ -0,0 +1,6 @@ +--- +"@clerk/clerk-js": minor +"@clerk/ui": minor +--- + +Removed unused internal OAuthConsent prop. diff --git a/packages/clerk-js/sandbox/app.ts b/packages/clerk-js/sandbox/app.ts index 8277c29a117..8cb62856aed 100644 --- a/packages/clerk-js/sandbox/app.ts +++ b/packages/clerk-js/sandbox/app.ts @@ -486,7 +486,6 @@ void (async () => { scopes, oauthClientId: 'Wg9fP2d0pSFXCZ1u', redirectUrl: searchParams.get('redirect_uri') ?? 'http://localhost:4000/oauth/callback', - __internal_enableOrgSelection: true, }, ); }, diff --git a/packages/ui/src/components/OAuthConsent/OAuthConsent.tsx b/packages/ui/src/components/OAuthConsent/OAuthConsent.tsx index 5070c5745c3..9910905c096 100644 --- a/packages/ui/src/components/OAuthConsent/OAuthConsent.tsx +++ b/packages/ui/src/components/OAuthConsent/OAuthConsent.tsx @@ -72,7 +72,7 @@ function _OAuthConsent() { const redirectUrl = ctx.redirectUrl ?? getRedirectUriFromSearch(); const hasOrgReadScope = scopes.some(s => s.scope === USER_ORG_READ_SCOPE); - const orgSelectionEnabled = !!((hasOrgReadScope || ctx.enableOrgSelection) && organizationSettings.enabled); + const orgSelectionEnabled = !!(hasOrgReadScope && organizationSettings.enabled); const orgOptions = orgSelectionEnabled ? (user?.organizationMemberships ?? []).map(m => ({ value: m.organization.id, diff --git a/packages/ui/src/components/OAuthConsent/__tests__/OAuthConsent.test.tsx b/packages/ui/src/components/OAuthConsent/__tests__/OAuthConsent.test.tsx index 75125026834..917c7c4953c 100644 --- a/packages/ui/src/components/OAuthConsent/__tests__/OAuthConsent.test.tsx +++ b/packages/ui/src/components/OAuthConsent/__tests__/OAuthConsent.test.tsx @@ -390,25 +390,6 @@ describe('OAuthConsent', () => { }); }); - it('renders the org selector when __internal_enableOrgSelection is true (fallback for existing apps)', async () => { - const { wrapper, fixtures, props } = await createFixtures(f => { - f.withUser({ - email_addresses: ['jane@example.com'], - organization_memberships: [{ id: 'org_1', name: 'Acme Corp' }], - }); - f.withOrganizations(); - }); - - props.setProps({ componentName: 'OAuthConsent', __internal_enableOrgSelection: true } as any); - mockOAuthApplication(fixtures.clerk, { getConsentInfo: vi.fn().mockResolvedValue(fakeConsentInfo) }); - - const { getByText } = render(, { wrapper }); - - await waitFor(() => { - expect(getByText('Acme Corp')).toBeVisible(); - }); - }); - it('does not display user:org:read in the scopes list', async () => { const { wrapper, fixtures, props } = await createFixtures(f => { f.withUser({ diff --git a/packages/ui/src/contexts/ClerkUIComponentsContext.tsx b/packages/ui/src/contexts/ClerkUIComponentsContext.tsx index 24a3760c385..2e9bff531e2 100644 --- a/packages/ui/src/contexts/ClerkUIComponentsContext.tsx +++ b/packages/ui/src/contexts/ClerkUIComponentsContext.tsx @@ -142,7 +142,6 @@ export function ComponentContextProvider({ onAllow: p.onAllow, onDeny: p.onDeny, appearance: p.appearance, - enableOrgSelection: (p as any).__internal_enableOrgSelection === true, }} > {children} diff --git a/packages/ui/src/types.ts b/packages/ui/src/types.ts index 28b3d26c07a..0c92ab32a22 100644 --- a/packages/ui/src/types.ts +++ b/packages/ui/src/types.ts @@ -225,11 +225,6 @@ export type OAuthConsentCtx = { * Customize the appearance of the component. */ appearance?: ClerkAppearanceTheme; - /** - * When true, renders the organization picker and submits organization_id - * with the consent form. Internal use only, not exposed in the public prop type. - */ - enableOrgSelection?: boolean; }; export type SubscriptionDetailsCtx = __internal_SubscriptionDetailsProps & {