diff --git a/packages/browser/src/__legacy__/client.ts b/packages/browser/src/__legacy__/client.ts index 74359341a..dc5aea82e 100755 --- a/packages/browser/src/__legacy__/client.ts +++ b/packages/browser/src/__legacy__/client.ts @@ -719,7 +719,7 @@ export class AsgardeoSPAClient { if (config.signInRequired) { await this._validateMethod(); } else { - await this._validateMethod(); + // await this._validateMethod(); } if (!config.id) { diff --git a/packages/browser/src/__legacy__/clients/main-thread-client.ts b/packages/browser/src/__legacy__/clients/main-thread-client.ts index cd0d9908d..79900c12b 100755 --- a/packages/browser/src/__legacy__/clients/main-thread-client.ts +++ b/packages/browser/src/__legacy__/clients/main-thread-client.ts @@ -85,7 +85,7 @@ export const MainThreadClient = async ( let _getSignOutURLFromSessionStorage: boolean = false; - const _httpClient: HttpClientInstance = HttpClient.getInstance(); + const _httpClient: HttpClientInstance = HttpClient.getInstance(instanceID); let _isHttpHandlerEnabled: boolean = true; let _httpErrorCallback: (error: HttpError) => void | Promise; let _httpFinishCallback: () => void; diff --git a/packages/browser/src/__legacy__/http-client/clients/axios-http-client.ts b/packages/browser/src/__legacy__/http-client/clients/axios-http-client.ts index d6f56f86e..fc84a3fb8 100755 --- a/packages/browser/src/__legacy__/http-client/clients/axios-http-client.ts +++ b/packages/browser/src/__legacy__/http-client/clients/axios-http-client.ts @@ -41,9 +41,9 @@ import {HttpClientInstance, HttpClientInterface, HttpClientStatic} from '../mode */ @staticDecorator>() export class HttpClient implements HttpClientInterface { - private static axiosInstance: HttpClientInstance; - private static clientInstance: HttpClient; - private static isHandlerEnabled: boolean; + private static instances: Map = new Map(); + private static clientInstances: Map = new Map(); + private isHandlerEnabled: boolean; private attachToken: (request: HttpRequestConfig) => Promise = () => Promise.resolve(); private requestStartCallback: (request: HttpRequestConfig) => void = () => null; private requestSuccessCallback: (response: HttpResponse) => void = () => null; @@ -66,48 +66,51 @@ export class HttpClient implements HttpClientInterface await this.clientInstance.requestHandler(request as HttpRequestConfig) as InternalAxiosRequestConfig); + axiosInstance.interceptors.request.use(async (request: InternalAxiosRequestConfig) => await clientInstance.requestHandler(request as HttpRequestConfig) as InternalAxiosRequestConfig); // Register response interceptor - this.axiosInstance.interceptors.response.use( - response => this.clientInstance.successHandler(response), - error => this.clientInstance.errorHandler(error), + axiosInstance.interceptors.response.use( + response => clientInstance.successHandler(response), + error => clientInstance.errorHandler(error), ); // Add the missing helper methods from axios - this.axiosInstance.all = axios.all; - this.axiosInstance.spread = axios.spread; + axiosInstance.all = axios.all; + axiosInstance.spread = axios.spread; // Add the init method from the `HttpClient` instance. - this.axiosInstance.init = this.clientInstance.init; + axiosInstance.init = clientInstance.init; // Add the handler enabling & disabling methods to the instance. - this.axiosInstance.enableHandler = this.clientInstance.enableHandler; - this.axiosInstance.disableHandler = this.clientInstance.disableHandler; - this.axiosInstance.disableHandlerWithTimeout = this.clientInstance.disableHandlerWithTimeout; - this.axiosInstance.setHttpRequestStartCallback = this.clientInstance.setHttpRequestStartCallback; - this.axiosInstance.setHttpRequestSuccessCallback = this.clientInstance.setHttpRequestSuccessCallback; - this.axiosInstance.setHttpRequestErrorCallback = this.clientInstance.setHttpRequestErrorCallback; - this.axiosInstance.setHttpRequestFinishCallback = this.clientInstance.setHttpRequestFinishCallback; - return this.axiosInstance; + axiosInstance.enableHandler = clientInstance.enableHandler; + axiosInstance.disableHandler = clientInstance.disableHandler; + axiosInstance.disableHandlerWithTimeout = clientInstance.disableHandlerWithTimeout; + axiosInstance.setHttpRequestStartCallback = clientInstance.setHttpRequestStartCallback; + axiosInstance.setHttpRequestSuccessCallback = clientInstance.setHttpRequestSuccessCallback; + axiosInstance.setHttpRequestErrorCallback = clientInstance.setHttpRequestErrorCallback; + axiosInstance.setHttpRequestFinishCallback = clientInstance.setHttpRequestFinishCallback; + + this.instances.set(instanceId, axiosInstance); + return axiosInstance; } /** @@ -134,7 +137,7 @@ export class HttpClient implements HttpClientInterface Promise, ): Promise { - HttpClient.isHandlerEnabled = isHandlerEnabled; + this.isHandlerEnabled = isHandlerEnabled; this.attachToken = attachToken; } @@ -203,14 +206,14 @@ export class HttpClient implements HttpClientInterface { - HttpClient.isHandlerEnabled = true; + this.isHandlerEnabled = true; }, timeout); } diff --git a/packages/browser/src/__legacy__/http-client/models/http-client.ts b/packages/browser/src/__legacy__/http-client/models/http-client.ts index d6e612fed..9c0783c6b 100644 --- a/packages/browser/src/__legacy__/http-client/models/http-client.ts +++ b/packages/browser/src/__legacy__/http-client/models/http-client.ts @@ -23,7 +23,7 @@ import { HttpError, HttpResponse } from "../../models"; * Http client interface with static functions. */ export interface HttpClientStatic { - getInstance(): S; + getInstance(instanceId?: number): S; } /** diff --git a/packages/javascript/src/StorageManager.ts b/packages/javascript/src/StorageManager.ts index c955b2efb..d27d353c8 100644 --- a/packages/javascript/src/StorageManager.ts +++ b/packages/javascript/src/StorageManager.ts @@ -75,8 +75,17 @@ class StorageManager { await this.store.setData(key, dataToBeSavedJSON); } - protected resolveKey(store: Stores | string, userId?: string): string { - return userId ? `${store}-${this.id}-${userId}` : `${store}-${this.id}`; + protected resolveKey(store: Stores | string, userId?: string, instanceId?: string): string { + if (userId && instanceId) { + return `${store}-${instanceId}-${userId}`; + } + if (userId) { + return `${store}-${this.id}-${userId}`; + } + if (instanceId) { + return `${store}-${instanceId}`; + } + return `${store}-${this.id}`; } protected static isLocalStorageAvailable(): boolean { @@ -124,8 +133,8 @@ class StorageManager { return JSON.parse((await this.store.getData(this.resolveKey(Stores.TemporaryData, userId))) ?? null); } - public async getSessionData(userId?: string): Promise { - return JSON.parse((await this.store.getData(this.resolveKey(Stores.SessionData, userId))) ?? null); + public async getSessionData(userId?: string, instanceId?: string): Promise { + return JSON.parse((await this.store.getData(this.resolveKey(Stores.SessionData, userId, instanceId))) ?? null); } public async getCustomData(key: string, userId?: string): Promise { diff --git a/packages/javascript/src/__legacy__/client.ts b/packages/javascript/src/__legacy__/client.ts index 043829737..d96b4b3e2 100644 --- a/packages/javascript/src/__legacy__/client.ts +++ b/packages/javascript/src/__legacy__/client.ts @@ -914,77 +914,89 @@ export class AsgardeoAuthClient { * @preserve */ public async exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise { - const oidcProviderMetadata: OIDCDiscoveryApiResponse = await this.oidcProviderMetaDataProvider(); - const configData: StrictAuthClientConfig = await this.configProvider(); + const executeTokenExchange = async (): Promise => { + const oidcProviderMetadata: OIDCDiscoveryApiResponse = await this.oidcProviderMetaDataProvider(); + const configData: StrictAuthClientConfig = await this.configProvider(); - let tokenEndpoint: string | undefined; + let tokenEndpoint: string | undefined; - if (config.tokenEndpoint && config.tokenEndpoint.trim().length !== 0) { - tokenEndpoint = config.tokenEndpoint; - } else { - tokenEndpoint = oidcProviderMetadata.token_endpoint; - } + if (config.tokenEndpoint && config.tokenEndpoint.trim().length !== 0) { + tokenEndpoint = config.tokenEndpoint; + } else { + tokenEndpoint = oidcProviderMetadata.token_endpoint; + } - if (!tokenEndpoint || tokenEndpoint.trim().length === 0) { - throw new AsgardeoAuthException( - 'JS-AUTH_CORE-RCG-NF01', - 'Token endpoint not found.', - 'No token endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' + - 'or the token endpoint passed to the SDK is empty.', - ); - } + if (!tokenEndpoint || tokenEndpoint.trim().length === 0) { + throw new AsgardeoAuthException( + 'JS-AUTH_CORE-RCG-NF01', + 'Token endpoint not found.', + 'No token endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' + + 'or the token endpoint passed to the SDK is empty.', + ); + } - const data: string[] = await Promise.all( - Object.entries(config.data).map(async ([key, value]: [key: string, value: any]) => { - const newValue: string = await this.authHelper.replaceCustomGrantTemplateTags(value as string, userId); + const data: string[] = await Promise.all( + Object.entries(config.data).map(async ([key, value]: [key: string, value: any]) => { + const newValue: string = await this.authHelper.replaceCustomGrantTemplateTags(value as string, userId); - return `${key}=${newValue}`; - }), - ); + return `${key}=${newValue}`; + }), + ); - let requestHeaders: Record = { - Accept: 'application/json', - 'Content-Type': 'application/x-www-form-urlencoded', - }; + let requestHeaders: Record = { + Accept: 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded', + }; - if (config.attachToken) { - requestHeaders = { - ...requestHeaders, - Authorization: `Bearer ${(await this.storageManager.getSessionData(userId)).access_token}`, + if (config.attachToken) { + requestHeaders = { + ...requestHeaders, + Authorization: `Bearer ${(await this.storageManager.getSessionData(userId)).access_token}`, + }; + } + + const requestConfig: RequestInit = { + body: data.join('&'), + credentials: configData.sendCookiesInRequests ? 'include' : 'same-origin', + headers: new Headers(requestHeaders), + method: 'POST', }; - } - const requestConfig: RequestInit = { - body: data.join('&'), - credentials: configData.sendCookiesInRequests ? 'include' : 'same-origin', - headers: new Headers(requestHeaders), - method: 'POST', - }; + let response: Response; - let response: Response; + try { + response = await fetch(tokenEndpoint, requestConfig); + } catch (error: any) { + throw new AsgardeoAuthException( + 'JS-AUTH_CORE-RCG-NE02', + 'The custom grant request failed.', + error ?? 'The request sent to get the custom grant failed.', + ); + } - try { - response = await fetch(tokenEndpoint, requestConfig); - } catch (error: any) { - throw new AsgardeoAuthException( - 'JS-AUTH_CORE-RCG-NE02', - 'The custom grant request failed.', - error ?? 'The request sent to get the custom grant failed.', - ); - } + if (response.status !== 200 || !response.ok) { + throw new AsgardeoAuthException( + 'JS-AUTH_CORE-RCG-HE03', + `Invalid response status received for the custom grant request. (${response.statusText})`, + (await response.json()) as string, + ); + } - if (response.status !== 200 || !response.ok) { - throw new AsgardeoAuthException( - 'JS-AUTH_CORE-RCG-HE03', - `Invalid response status received for the custom grant request. (${response.statusText})`, - (await response.json()) as string, - ); - } + if (config.returnsSession) { + return this.authHelper.handleTokenResponse(response, userId); + } + return Promise.resolve((await response.json()) as TokenResponse | Response); + }; - if (config.returnsSession) { - return this.authHelper.handleTokenResponse(response, userId); + if ( + await this.storageManager.getTemporaryDataParameter( + OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED, + ) + ) { + return executeTokenExchange(); } - return Promise.resolve((await response.json()) as TokenResponse | Response); + + return this.loadOpenIDProviderConfiguration(false).then(() => executeTokenExchange()); } /** diff --git a/packages/javascript/src/__legacy__/helpers/authentication-helper.ts b/packages/javascript/src/__legacy__/helpers/authentication-helper.ts index 4553b9011..e0ca352f1 100644 --- a/packages/javascript/src/__legacy__/helpers/authentication-helper.ts +++ b/packages/javascript/src/__legacy__/helpers/authentication-helper.ts @@ -238,7 +238,31 @@ export class AuthenticationHelper { public async replaceCustomGrantTemplateTags(text: string, userId?: string): Promise { const configData: StrictAuthClientConfig = await this.config(); - const sessionData: SessionData = await this.storageManager.getSessionData(userId); + + const sourceInstanceId: string | number | null = configData.organizationChain?.sourceInstanceId ?? null; + + let sessionData: SessionData; + + if (sourceInstanceId) { + const {clientId} = configData; + let instanceKey: string; + if (clientId) { + instanceKey = `instance_${sourceInstanceId}-${clientId}`; + } else { + instanceKey = `instance_${sourceInstanceId}`; + } + sessionData = await this.storageManager.getSessionData(userId, instanceKey); + + if (!sessionData.access_token) { + throw new AsgardeoAuthException( + 'JS-AUTH_HELPER-RCGTT-NE01', + 'No session data found for source instance.', + 'Failed to retrieve session data from the source organization context.', + ); + } + } else { + sessionData = await this.storageManager.getSessionData(userId); + } const scope: string = processOpenIDScopes(configData.scopes); diff --git a/packages/javascript/src/__legacy__/models/client-config.ts b/packages/javascript/src/__legacy__/models/client-config.ts index 6a5c94b7c..636e41756 100644 --- a/packages/javascript/src/__legacy__/models/client-config.ts +++ b/packages/javascript/src/__legacy__/models/client-config.ts @@ -26,6 +26,18 @@ export interface DefaultAuthClientConfig { clientId?: string; clientSecret?: string; enablePKCE?: boolean; + organizationChain?: { + /** + * Instance ID of the source organization context to retrieve access token from for organization token exchange. + * Used in linked organization scenarios to automatically fetch the source organization's access token. + */ + sourceInstanceId?: string | number; + /** + * Organization ID for the target organization. + * When provided with sourceInstanceId, triggers automatic organization token exchange. + */ + targetOrganizationId?: string; + }; prompt?: string; responseMode?: OAuthResponseMode; scopes?: string | string[] | undefined; diff --git a/packages/javascript/src/models/config.ts b/packages/javascript/src/models/config.ts index 86bdfe1e2..074107deb 100644 --- a/packages/javascript/src/models/config.ts +++ b/packages/javascript/src/models/config.ts @@ -129,6 +129,24 @@ export interface BaseConfig extends WithPreferences { */ instanceId?: number; + /** + * Configuration for chaining authentication across multiple organization contexts. + * Used when you need to authenticate a user in one organization using credentials + * from another organization context. + */ + organizationChain?: { + /** + * Instance ID of the source organization context to retrieve access token from for organization token exchange. + * Used in linked organization scenarios to automatically fetch the source organization's access token. + */ + sourceInstanceId?: number; + /** + * Organization ID for the target organization. + * When provided with sourceInstanceId, triggers automatic organization token exchange. + */ + targetOrganizationId?: string; + }; + /** * Optional organization handle for the Organization in Asgardeo. * This is used to identify the organization in the Asgardeo identity server in cases like Branding, etc. diff --git a/packages/react/src/AsgardeoReactClient.ts b/packages/react/src/AsgardeoReactClient.ts index eb3d2884d..e9655beec 100644 --- a/packages/react/src/AsgardeoReactClient.ts +++ b/packages/react/src/AsgardeoReactClient.ts @@ -276,6 +276,9 @@ class AsgardeoReactClient e override async switchOrganization(organization: Organization): Promise { return this.withLoading(async () => { try { + const configData: any = await this.asgardeo.getConfigData(); + const sourceInstanceId: number | undefined = configData?.organizationChain?.sourceInstanceId; + if (!organization.id) { throw new AsgardeoRuntimeError( 'Organization ID is required for switching organizations', @@ -296,7 +299,7 @@ class AsgardeoReactClient e }, id: 'organization-switch', returnsSession: true, - signInRequired: true, + signInRequired: sourceInstanceId === undefined, }; return (await this.asgardeo.exchangeToken(exchangeConfig, () => {})) as TokenResponse | Response; diff --git a/packages/react/src/components/control/OrganizationContext/OrganizationContext.tsx b/packages/react/src/components/control/OrganizationContext/OrganizationContext.tsx new file mode 100644 index 000000000..890d1879a --- /dev/null +++ b/packages/react/src/components/control/OrganizationContext/OrganizationContext.tsx @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {FC, PropsWithChildren} from 'react'; +import OrganizationContextController from './OrganizationContextController'; +import AsgardeoProvider, {AsgardeoProviderProps} from '../../../contexts/Asgardeo/AsgardeoProvider'; +import useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo'; + +export interface OrganizationContextProps extends Omit { + /** + * Optional base URL for the organization context. If not provided, it will default to the source provider's base URL. + */ + baseUrl?: string; + /** + * Instance ID for this organization context. Must be unique across the app if multiple contexts are used. + */ + instanceId: number; + /** + * Optional source instance ID. If not provided, immediate parent provider is used as source. + */ + sourceInstanceId?: number; + /** + * ID of the organization to authenticate with + */ + targetOrganizationId: string; +} + +const OrganizationContext: FC> = ({ + instanceId, + baseUrl, + clientId, + afterSignInUrl, + afterSignOutUrl, + targetOrganizationId, + sourceInstanceId, + scopes, + children, + ...rest +}: PropsWithChildren) => { + // Get the source provider's signed-in status + const { + isSignedIn: isSourceSignedIn, + instanceId: sourceInstanceIdFromContext, + baseUrl: sourceBaseUrl, + clientId: sourceClientId, + } = useAsgardeo(); + + return ( + + + {children} + + + ); +}; + +export default OrganizationContext; diff --git a/packages/react/src/components/control/OrganizationContext/OrganizationContextController.tsx b/packages/react/src/components/control/OrganizationContext/OrganizationContextController.tsx new file mode 100644 index 000000000..c2a4cdb90 --- /dev/null +++ b/packages/react/src/components/control/OrganizationContext/OrganizationContextController.tsx @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import {Organization} from '@asgardeo/browser'; +import {FC, useEffect, useRef} from 'react'; +import useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo'; + +interface OrganizationContextControllerProps { + /** + * Children to render + */ + children: React.ReactNode; + /** + * Whether the source provider is signed in + */ + isSourceSignedIn: boolean; + /** + * ID of the organization to authenticate with + */ + targetOrganizationId: string; +} + +const OrganizationContextController: FC = ({ + targetOrganizationId, + isSourceSignedIn, + children, +}: OrganizationContextControllerProps) => { + const {isInitialized, isSignedIn, switchOrganization, isLoading} = useAsgardeo(); + const hasAuthenticatedRef: React.MutableRefObject = useRef(false); + const isAuthenticatingRef: React.MutableRefObject = useRef(false); + + /** + * Handle the organization switch when: + * - Current instance is initialized and NOT signed in + * - Source provider IS signed in + * Uses the `switchOrganization` function from the Asgardeo context. + */ + useEffect(() => { + const performOrganizationSwitch = async (): Promise => { + // Prevent multiple authentication attempts + if (hasAuthenticatedRef.current || isAuthenticatingRef.current) { + return; + } + + // Wait for initialization to complete + if (!isInitialized || isLoading) { + return; + } + + // Only proceed if user is not already signed in to this instance + if (isSignedIn) { + hasAuthenticatedRef.current = true; + return; + } + + // CRITICAL: Only proceed if source provider is signed in + if (!isSourceSignedIn) { + return; + } + + try { + isAuthenticatingRef.current = true; + hasAuthenticatedRef.current = true; + + // Build the organization object for authentication + const targetOrganization: Organization = { + id: targetOrganizationId, + name: '', // Name will be populated after authentication + orgHandle: '', // Will be populated after authentication + }; + + // Call the switchOrganization API from context (handles token exchange) + await switchOrganization(targetOrganization); + } catch (error) { + // eslint-disable-next-line no-console + console.error('Linked organization authentication failed:', error); + + // Reset the flag to allow retry + hasAuthenticatedRef.current = false; + } finally { + isAuthenticatingRef.current = false; + } + }; + + performOrganizationSwitch(); + }, [isInitialized, isSignedIn, isLoading, isSourceSignedIn, targetOrganizationId, switchOrganization]); + + return <>{children}; +}; + +export default OrganizationContextController; diff --git a/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts b/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts index be72704d7..4c0a79bbd 100644 --- a/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts +++ b/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts @@ -36,6 +36,7 @@ export type AsgardeoContextProps = { afterSignInUrl: string | undefined; applicationId: string | undefined; baseUrl: string | undefined; + clientId: string | undefined; /** * Swaps the current access token with a new one based on the provided configuration (with a grant type). * @param config - Configuration for the token exchange request. @@ -161,6 +162,7 @@ const AsgardeoContext: Context = createContext {}, + clientId: undefined, exchangeToken: null, getAccessToken: null, getDecodedIdToken: null, diff --git a/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx b/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx index 392b754f1..375a7c407 100644 --- a/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx +++ b/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx @@ -66,6 +66,7 @@ const AsgardeoProvider: FC> = ({ signInOptions, syncSession, instanceId = 0, + organizationChain, ...rest }: PropsWithChildren): ReactElement => { const reRenderCheckRef: RefObject = useRef(false); @@ -87,6 +88,7 @@ const AsgardeoProvider: FC> = ({ applicationId, baseUrl, clientId, + organizationChain, organizationHandle, scopes, signInOptions, @@ -562,6 +564,7 @@ const AsgardeoProvider: FC> = ({ applicationId, baseUrl, clearSession, + clientId, exchangeToken, getAccessToken, getDecodedIdToken, @@ -575,6 +578,7 @@ const AsgardeoProvider: FC> = ({ isLoading: isLoadingSync, isSignedIn: isSignedInSync, organization: currentOrganization, + organizationChain, organizationHandle: config?.organizationHandle, platform: config?.platform, reInitialize, @@ -596,6 +600,7 @@ const AsgardeoProvider: FC> = ({ signUpUrl, afterSignInUrl, baseUrl, + clientId, isInitializedSync, isLoadingSync, isSignedInSync, @@ -617,6 +622,7 @@ const AsgardeoProvider: FC> = ({ clearSession, reInitialize, instanceId, + organizationChain, ], ); diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 4c51b7ac0..e2930f71e 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -32,9 +32,6 @@ export * from './contexts/User/UserProvider'; export {default as useUser} from './contexts/User/useUser'; -export {default as OrganizationContext} from './contexts/Organization/OrganizationContext'; -export * from './contexts/Organization/OrganizationContext'; - export {default as OrganizationProvider} from './contexts/Organization/OrganizationProvider'; export * from './contexts/Organization/OrganizationProvider'; @@ -109,6 +106,9 @@ export * from './components/control/SignedOut'; export {default as Loading} from './components/control/Loading'; export * from './components/control/Loading'; +export {default as OrganizationContext} from './components/control/OrganizationContext/OrganizationContext'; +export * from './components/control/OrganizationContext/OrganizationContext'; + export {default as BaseSignIn} from './components/presentation/auth/SignIn/BaseSignIn'; export * from './components/presentation/auth/SignIn/BaseSignIn';