Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/empty-ducks-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we still need to include the version changes here to bump the packages and build it

Let's write that it's an internal change

---
4 changes: 4 additions & 0 deletions packages/shared/src/types/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,10 @@ export type ClerkOptions = ClerkOptionsNavigation &
* directly with the provided Clerk instance. Used by React Native / Expo.
*/
runtimeEnvironment: 'headless';
/**
* Temporary flag that gates the self-serve OIDC flow in `<ConfigureSSO />`. Remove once the self-serve OIDC flow reaches GA.
*/
oidcSelfServe: boolean;
},
Record<string, any>
>;
Expand Down
14 changes: 11 additions & 3 deletions packages/ui/src/components/ConfigureSSO/ConfigureSSOContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { EnterpriseConnectionResource, OrganizationDomainResource } from '@clerk/shared/types';
import React, { type PropsWithChildren } from 'react';

import { useOptions } from '@/contexts';

import type { OrganizationEnterpriseConnection } from './domain/organizationEnterpriseConnection';
import type {
EnterpriseConnectionMutations,
Expand All @@ -11,9 +13,9 @@ import type {
export type { OrganizationDomainMutations };

/**
* Shared state for the ConfigureSSO wizard, persisted across steps. Everything
* is sourced from the umbrella `useOrganizationEnterpriseConnection` hook one
* level up, so the context never observes a loading state and the steps read
* Shared state for the ConfigureSSO wizard, persisted across steps. Connection
* state is sourced from the umbrella `useOrganizationEnterpriseConnection` hook
* one level up, so the context never observes a loading state and the steps read
* display gates / mutations from a single place instead of re-deriving.
*/
export interface ConfigureSSOData {
Expand All @@ -26,6 +28,8 @@ export interface ConfigureSSOData {
testRuns: TestRunsView;
organizationDomains: OrganizationDomainResource[] | undefined;
onExit?: () => void;
/** Temporary gate for the self-serve OIDC flow; remove at OIDC GA. */
isOIDCFlowEnabled: boolean;
}

interface ConfigureSSOProviderProps {
Expand Down Expand Up @@ -53,6 +57,8 @@ export const ConfigureSSOProvider = ({
onExit,
children,
}: PropsWithChildren<ConfigureSSOProviderProps>): JSX.Element => {
const isOIDCFlowEnabled = useOptions().experimental?.oidcSelfServe ?? false;

const value = React.useMemo<ConfigureSSOData>(
() => ({
contentRef,
Expand All @@ -63,6 +69,7 @@ export const ConfigureSSOProvider = ({
enterpriseConnectionMutations,
organizationDomainMutations,
onExit,
isOIDCFlowEnabled,
}),
[
contentRef,
Expand All @@ -73,6 +80,7 @@ export const ConfigureSSOProvider = ({
organizationDomains,
enterpriseConnection,
onExit,
isOIDCFlowEnabled,
],
);

Expand Down
Loading