Skip to content

Commit ca9e215

Browse files
committed
chore(clerk-js,ui): Remove unused internal OAuthConsent prop to render org selector
1 parent d7317c1 commit ca9e215

5 files changed

Lines changed: 1 addition & 27 deletions

File tree

packages/clerk-js/sandbox/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ void (async () => {
486486
scopes,
487487
oauthClientId: 'Wg9fP2d0pSFXCZ1u',
488488
redirectUrl: searchParams.get('redirect_uri') ?? 'http://localhost:4000/oauth/callback',
489-
__internal_enableOrgSelection: true,
490489
},
491490
);
492491
},

packages/ui/src/components/OAuthConsent/OAuthConsent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function _OAuthConsent() {
7272
const redirectUrl = ctx.redirectUrl ?? getRedirectUriFromSearch();
7373

7474
const hasOrgReadScope = scopes.some(s => s.scope === USER_ORG_READ_SCOPE);
75-
const orgSelectionEnabled = !!((hasOrgReadScope || ctx.enableOrgSelection) && organizationSettings.enabled);
75+
const orgSelectionEnabled = !!(hasOrgReadScope && organizationSettings.enabled);
7676
const orgOptions = orgSelectionEnabled
7777
? (user?.organizationMemberships ?? []).map(m => ({
7878
value: m.organization.id,

packages/ui/src/components/OAuthConsent/__tests__/OAuthConsent.test.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -390,25 +390,6 @@ describe('OAuthConsent', () => {
390390
});
391391
});
392392

393-
it('renders the org selector when __internal_enableOrgSelection is true (fallback for existing apps)', async () => {
394-
const { wrapper, fixtures, props } = await createFixtures(f => {
395-
f.withUser({
396-
email_addresses: ['jane@example.com'],
397-
organization_memberships: [{ id: 'org_1', name: 'Acme Corp' }],
398-
});
399-
f.withOrganizations();
400-
});
401-
402-
props.setProps({ componentName: 'OAuthConsent', __internal_enableOrgSelection: true } as any);
403-
mockOAuthApplication(fixtures.clerk, { getConsentInfo: vi.fn().mockResolvedValue(fakeConsentInfo) });
404-
405-
const { getByText } = render(<OAuthConsent />, { wrapper });
406-
407-
await waitFor(() => {
408-
expect(getByText('Acme Corp')).toBeVisible();
409-
});
410-
});
411-
412393
it('does not display user:org:read in the scopes list', async () => {
413394
const { wrapper, fixtures, props } = await createFixtures(f => {
414395
f.withUser({

packages/ui/src/contexts/ClerkUIComponentsContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export function ComponentContextProvider({
142142
onAllow: p.onAllow,
143143
onDeny: p.onDeny,
144144
appearance: p.appearance,
145-
enableOrgSelection: (p as any).__internal_enableOrgSelection === true,
146145
}}
147146
>
148147
{children}

packages/ui/src/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,6 @@ export type OAuthConsentCtx = {
225225
* Customize the appearance of the component.
226226
*/
227227
appearance?: ClerkAppearanceTheme;
228-
/**
229-
* When true, renders the organization picker and submits organization_id
230-
* with the consent form. Internal use only, not exposed in the public prop type.
231-
*/
232-
enableOrgSelection?: boolean;
233228
};
234229

235230
export type SubscriptionDetailsCtx = __internal_SubscriptionDetailsProps & {

0 commit comments

Comments
 (0)