diff --git a/.changeset/fancy-humans-thank.md b/.changeset/fancy-humans-thank.md new file mode 100644 index 000000000..d08b0fa5d --- /dev/null +++ b/.changeset/fancy-humans-thank.md @@ -0,0 +1,7 @@ +--- +'@asgardeo/javascript': minor +'@asgardeo/browser': minor +'@asgardeo/react': patch +--- + +Fix failure of calling authenticated APIs when using multiple AuthProvider instances diff --git a/packages/browser/src/__legacy__/client.ts b/packages/browser/src/__legacy__/client.ts index 54f47b543..74359341a 100755 --- a/packages/browser/src/__legacy__/client.ts +++ b/packages/browser/src/__legacy__/client.ts @@ -67,6 +67,8 @@ const DefaultConfig: Partial> = { /** * This class provides the necessary methods to implement authentication in a Single Page Application. + * Implements a Multiton pattern to support multi-tenancy scenarios where multiple authentication + * contexts need to coexist in the same application. * * @export * @class AsgardeoSPAClient @@ -175,15 +177,22 @@ export class AsgardeoSPAClient { } /** - * This method returns the instance of the singleton class. + * This method returns the instance of the client for the specified ID. + * Implements a Multiton pattern to support multiple authentication contexts. * If an ID is provided, it will return the instance with the given ID. - * If no ID is provided, it will return the default instance value 0. + * If no ID is provided, it will return the default instance (ID: 0). * - * @return {AsgardeoSPAClient} - Returns the instance of the singleton class. + * @param {number} id - Optional unique identifier for the instance. + * @return {AsgardeoSPAClient} - Returns the instance associated with the ID. * * @example * ``` + * // Single tenant application (default instance) * const auth = AsgardeoSPAClient.getInstance(); + * + * // Multi-instance application + * const instance1 = AsgardeoSPAClient.getInstance(1); + * const instance2 = AsgardeoSPAClient.getInstance(2); * ``` * * @link https://github.com/asgardeo/asgardeo-auth-spa-sdk/tree/master#getinstance @@ -192,22 +201,115 @@ export class AsgardeoSPAClient { * * @preserve */ - public static getInstance(id?: number): AsgardeoSPAClient | undefined { - if (id && this._instances?.get(id)) { - return this._instances.get(id); - } else if (!id && this._instances?.get(0)) { - return this._instances.get(0); + public static getInstance(id: number = 0): AsgardeoSPAClient { + if (!this._instances.has(id)) { + this._instances.set(id, new AsgardeoSPAClient(id)); } - if (id) { - this._instances.set(id, new AsgardeoSPAClient(id)); + return this._instances.get(id)!; + } + + /** + * This method checks if an instance exists for the given ID. + * + * @param {number} id - Optional unique identifier for the instance. + * @return {boolean} - Returns true if an instance exists for the ID. + * + * @example + * ``` + * if (AsgardeoSPAClient.hasInstance(1)) { + * const auth = AsgardeoSPAClient.getInstance(1); + * } + * ``` + * + * @memberof AsgardeoSPAClient + */ + public static hasInstance(id: number = 0): boolean { + return this._instances.has(id); + } - return this._instances.get(id); + /** + * This method removes and cleans up a specific instance. + * Useful when an instance is no longer needed. + * + * @param {number} id - Optional unique identifier for the instance to destroy. + * @return {boolean} - Returns true if the instance was found and removed. + * + * @example + * ``` + * // Remove a specific instance + * AsgardeoSPAClient.destroyInstance(1); + * + * // Remove the default instance + * AsgardeoSPAClient.destroyInstance(); + * ``` + * + * @memberof AsgardeoSPAClient + */ + public static destroyInstance(id: number = 0): boolean { + const instance = this._instances.get(id); + if (instance) { + // Clean up the instance's session data before removing it + instance.clearSession(); + return this._instances.delete(id); } + return false; + } - this._instances.set(0, new AsgardeoSPAClient(0)); + /** + * This method returns all active instance IDs. + * Useful for debugging or managing multiple instances. + * + * @return {number[]} - Returns an array of all active instance IDs. + * + * @example + * ``` + * const activeInstances = AsgardeoSPAClient.getInstanceKeys(); + * console.log('Active instances:', activeInstances); + * ``` + * + * @memberof AsgardeoSPAClient + */ + public static getInstanceKeys(): number[] { + return Array.from(this._instances.keys()); + } - return this._instances.get(0); + /** + * This method removes all instances. + * Useful for cleanup in testing scenarios or application teardown. + * + * @example + * ``` + * AsgardeoSPAClient.destroyAllInstances(); + * ``` + * + * @memberof AsgardeoSPAClient + */ + public static destroyAllInstances(): void { + // Clean up each instance's session data before clearing + this._instances.forEach((instance) => { + instance.clearSession(); + }); + this._instances.clear(); + } + + /** + * This method returns the instance ID for this client instance. + * + * @return {number} - The instance ID. + * + * @example + * ``` + * const auth = AsgardeoSPAClient.getInstance(1); + * console.log(auth.getInstanceId()); // 1 + * ``` + * + * @memberof AsgardeoSPAClient + * + * @preserve + */ + public getInstanceId(): number { + return this._instanceID; } /** diff --git a/packages/browser/src/utils/http.ts b/packages/browser/src/utils/http.ts index 2c18b3143..a69932708 100644 --- a/packages/browser/src/utils/http.ts +++ b/packages/browser/src/utils/http.ts @@ -20,30 +20,53 @@ import {AsgardeoSPAClient} from '../__legacy__/client'; /** - * HTTP utility for making requests using the AsgardeoSPAClient instance. + * Creates an HTTP utility for making requests using a specific AsgardeoSPAClient instance. + * + * @param instanceId - Optional instance ID for multi-instance support. Defaults to 0. + * @returns An object with request and requestAll methods bound to the specified instance. * * @remarks - * This utility provides methods to make single or multiple HTTP requests. + * This utility provides methods to make single or multiple HTTP requests for a specific instance. + * + * @example + * ```typescript + * // Use default instance + * const httpClient = http(); + * + * // Use specific instance + * const httpInstance1 = http(1); + * const httpInstance2 = http(2); + * ``` */ -const http: { +export const http = ( + instanceId: number = 0, +): { request: typeof AsgardeoSPAClient.prototype.httpRequest; requestAll: typeof AsgardeoSPAClient.prototype.httpRequestAll; -} = { - /** - * Makes a single HTTP request using the AsgardeoSPAClient instance. - * - * @param config - The HTTP request configuration object. - * @returns A promise resolving to the HTTP response. - */ - request: AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()), +} => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); - /** - * Makes multiple HTTP requests in parallel using the AsgardeoSPAClient instance. - * - * @param configs - An array of HTTP request configuration objects. - * @returns A promise resolving to an array of HTTP responses. - */ - requestAll: AsgardeoSPAClient.getInstance().httpRequestAll.bind(AsgardeoSPAClient.getInstance()), + return { + /** + * Makes a single HTTP request using the AsgardeoSPAClient instance. + * + * @param config - The HTTP request configuration object. + * @returns A promise resolving to the HTTP response. + */ + request: client.httpRequest.bind(client), + + /** + * Makes multiple HTTP requests in parallel using the AsgardeoSPAClient instance. + * + * @param configs - An array of HTTP request configuration objects. + * @returns A promise resolving to an array of HTTP responses. + */ + requestAll: client.httpRequestAll.bind(client), + }; }; -export default http; +/** + * Default HTTP utility using instance 0. + * For multi-instance support, use http(instanceId) instead. + */ +export default http(); diff --git a/packages/javascript/src/__legacy__/client.ts b/packages/javascript/src/__legacy__/client.ts index ee254db8e..043829737 100644 --- a/packages/javascript/src/__legacy__/client.ts +++ b/packages/javascript/src/__legacy__/client.ts @@ -127,7 +127,7 @@ export class AsgardeoAuthClient { this.instanceIdValue += 1; } - if (instanceID) { + if (instanceID !== undefined) { this.instanceIdValue = instanceID; } diff --git a/packages/react/src/AsgardeoReactClient.ts b/packages/react/src/AsgardeoReactClient.ts index ac4de3e74..eb3d2884d 100644 --- a/packages/react/src/AsgardeoReactClient.ts +++ b/packages/react/src/AsgardeoReactClient.ts @@ -189,8 +189,8 @@ class AsgardeoReactClient e baseUrl = configData?.baseUrl; } - const profile: User = await getScim2Me({baseUrl}); - const schemas: any = await getSchemas({baseUrl}); + const profile: User = await getScim2Me({baseUrl, instanceId: this.getInstanceId()}); + const schemas: any = await getSchemas({baseUrl, instanceId: this.getInstanceId()}); const processedSchemas: any = flattenUserSchema(schemas); @@ -220,7 +220,7 @@ class AsgardeoReactClient e baseUrl = configData?.baseUrl; } - return await getMeOrganizations({baseUrl}); + return await getMeOrganizations({baseUrl, instanceId: this.getInstanceId()}); } catch (error) { throw new AsgardeoRuntimeError( `Failed to fetch the user's associated organizations: ${ @@ -242,7 +242,7 @@ class AsgardeoReactClient e baseUrl = configData?.baseUrl; } - return await getAllOrganizations({baseUrl}); + return await getAllOrganizations({baseUrl, instanceId: this.getInstanceId()}); } catch (error) { throw new AsgardeoRuntimeError( `Failed to fetch all organizations: ${error instanceof Error ? error.message : String(error)}`, diff --git a/packages/react/src/api/createOrganization.ts b/packages/react/src/api/createOrganization.ts index ca8653aad..7ae7163c4 100644 --- a/packages/react/src/api/createOrganization.ts +++ b/packages/react/src/api/createOrganization.ts @@ -26,8 +26,6 @@ import { CreateOrganizationConfig as BaseCreateOrganizationConfig, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the createOrganization request (React-specific) */ @@ -37,6 +35,10 @@ export interface CreateOrganizationConfig extends Omit Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -90,8 +92,14 @@ export interface CreateOrganizationConfig extends Omit => { +const createOrganization = async ({ + fetcher, + instanceId = 0, + ...requestConfig +}: CreateOrganizationConfig): Promise => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ data: config.body ? JSON.parse(config.body as string) : undefined, headers: config.headers as Record, diff --git a/packages/react/src/api/getAllOrganizations.ts b/packages/react/src/api/getAllOrganizations.ts index 8686016ae..b629c5103 100644 --- a/packages/react/src/api/getAllOrganizations.ts +++ b/packages/react/src/api/getAllOrganizations.ts @@ -26,8 +26,6 @@ import { AllOrganizationsApiResponse, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the getAllOrganizations request (React-specific) */ @@ -37,6 +35,10 @@ export interface GetAllOrganizationsConfig extends Omit Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -84,9 +86,12 @@ export interface GetAllOrganizationsConfig extends Omit => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ headers: config.headers as Record, method: config.method || 'GET', diff --git a/packages/react/src/api/getMeOrganizations.ts b/packages/react/src/api/getMeOrganizations.ts index ff8adb0fc..55172d598 100644 --- a/packages/react/src/api/getMeOrganizations.ts +++ b/packages/react/src/api/getMeOrganizations.ts @@ -26,8 +26,6 @@ import { GetMeOrganizationsConfig as BaseGetMeOrganizationsConfig, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the getMeOrganizations request (React-specific) */ @@ -37,6 +35,10 @@ export interface GetMeOrganizationsConfig extends Omit Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -86,8 +88,14 @@ export interface GetMeOrganizationsConfig extends Omit => { +const getMeOrganizations = async ({ + fetcher, + instanceId = 0, + ...requestConfig +}: GetMeOrganizationsConfig): Promise => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ headers: config.headers as Record, method: config.method || 'GET', diff --git a/packages/react/src/api/getOrganization.ts b/packages/react/src/api/getOrganization.ts index 227707c2e..894bb714b 100644 --- a/packages/react/src/api/getOrganization.ts +++ b/packages/react/src/api/getOrganization.ts @@ -26,8 +26,6 @@ import { OrganizationDetails, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the getOrganization request (React-specific) */ @@ -37,6 +35,10 @@ export interface GetOrganizationConfig extends Omit Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -78,8 +80,14 @@ export interface GetOrganizationConfig extends Omit => { +const getOrganization = async ({ + fetcher, + instanceId = 0, + ...requestConfig +}: GetOrganizationConfig): Promise => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ headers: config.headers as Record, method: config.method || 'GET', diff --git a/packages/react/src/api/getSchemas.ts b/packages/react/src/api/getSchemas.ts index 746a814b4..df216b814 100644 --- a/packages/react/src/api/getSchemas.ts +++ b/packages/react/src/api/getSchemas.ts @@ -26,8 +26,6 @@ import { GetSchemasConfig as BaseGetSchemasConfig, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the getSchemas request (React-specific) */ @@ -37,6 +35,10 @@ export interface GetSchemasConfig extends Omit * which is a wrapper around axios http.request */ fetcher?: (url: string, config: RequestInit) => Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -76,8 +78,10 @@ export interface GetSchemasConfig extends Omit * } * ``` */ -const getSchemas = async ({fetcher, ...requestConfig}: GetSchemasConfig): Promise => { +const getSchemas = async ({fetcher, instanceId = 0, ...requestConfig}: GetSchemasConfig): Promise => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ headers: config.headers as Record, method: config.method || 'GET', diff --git a/packages/react/src/api/getScim2Me.ts b/packages/react/src/api/getScim2Me.ts index 326d02a3b..f87fbad07 100644 --- a/packages/react/src/api/getScim2Me.ts +++ b/packages/react/src/api/getScim2Me.ts @@ -26,8 +26,6 @@ import { GetScim2MeConfig as BaseGetScim2MeConfig, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the getScim2Me request (React-specific) */ @@ -37,6 +35,10 @@ export interface GetScim2MeConfig extends Omit * which is a wrapper around axios http.request */ fetcher?: (url: string, config: RequestInit) => Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -76,8 +78,10 @@ export interface GetScim2MeConfig extends Omit * } * ``` */ -const getScim2Me = async ({fetcher, ...requestConfig}: GetScim2MeConfig): Promise => { +const getScim2Me = async ({fetcher, instanceId = 0, ...requestConfig}: GetScim2MeConfig): Promise => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ headers: config.headers as Record, method: config.method || 'GET', diff --git a/packages/react/src/api/updateMeProfile.ts b/packages/react/src/api/updateMeProfile.ts index c14413851..5be5dc0e8 100644 --- a/packages/react/src/api/updateMeProfile.ts +++ b/packages/react/src/api/updateMeProfile.ts @@ -26,8 +26,6 @@ import { UpdateMeProfileConfig as BaseUpdateMeProfileConfig, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the updateMeProfile request (React-specific) */ @@ -37,6 +35,10 @@ export interface UpdateMeProfileConfig extends Omit Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -64,8 +66,10 @@ export interface UpdateMeProfileConfig extends Omit => { +const updateMeProfile = async ({fetcher, instanceId = 0, ...requestConfig}: UpdateMeProfileConfig): Promise => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ data: config.body ? JSON.parse(config.body as string) : undefined, headers: config.headers as Record, diff --git a/packages/react/src/api/updateOrganization.ts b/packages/react/src/api/updateOrganization.ts index 6c62b7b10..26f2b527d 100644 --- a/packages/react/src/api/updateOrganization.ts +++ b/packages/react/src/api/updateOrganization.ts @@ -27,8 +27,6 @@ import { createPatchOperations, } from '@asgardeo/browser'; -const httpClient: HttpInstance = AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()); - /** * Configuration for the updateOrganization request (React-specific) */ @@ -38,6 +36,10 @@ export interface UpdateOrganizationConfig extends Omit Promise; + /** + * Optional instance ID for multi-instance support. Defaults to 0. + */ + instanceId?: number; } /** @@ -87,9 +89,12 @@ export interface UpdateOrganizationConfig extends Omit => { const defaultFetcher = async (url: string, config: RequestInit): Promise => { + const client: AsgardeoSPAClient = AsgardeoSPAClient.getInstance(instanceId); + const httpClient: HttpInstance = client.httpRequest.bind(client); const response: HttpResponse = await httpClient({ data: config.body ? JSON.parse(config.body as string) : undefined, headers: config.headers as Record, diff --git a/packages/react/src/components/presentation/CreateOrganization/CreateOrganization.tsx b/packages/react/src/components/presentation/CreateOrganization/CreateOrganization.tsx index 8a7b69424..6a9b6d940 100644 --- a/packages/react/src/components/presentation/CreateOrganization/CreateOrganization.tsx +++ b/packages/react/src/components/presentation/CreateOrganization/CreateOrganization.tsx @@ -76,7 +76,7 @@ export const CreateOrganization: FC = ({ defaultParentId, ...props }: CreateOrganizationProps): ReactElement => { - const {isSignedIn, baseUrl} = useAsgardeo(); + const {isSignedIn, baseUrl, instanceId} = useAsgardeo(); const {currentOrganization, revalidateMyOrganizations} = useOrganization(); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); @@ -108,6 +108,7 @@ export const CreateOrganization: FC = ({ result = await createOrganization({ baseUrl, + instanceId, payload: { ...payload, parentId, diff --git a/packages/react/src/components/presentation/OrganizationProfile/OrganizationProfile.tsx b/packages/react/src/components/presentation/OrganizationProfile/OrganizationProfile.tsx index e168bf31f..ae7348070 100644 --- a/packages/react/src/components/presentation/OrganizationProfile/OrganizationProfile.tsx +++ b/packages/react/src/components/presentation/OrganizationProfile/OrganizationProfile.tsx @@ -146,7 +146,7 @@ const OrganizationProfile: FC = ({ errorFallback, ...rest }: OrganizationProfileProps): ReactElement => { - const {baseUrl} = useAsgardeo(); + const {baseUrl, instanceId} = useAsgardeo(); const {t} = useTranslation(); const [organization, setOrganization] = useState(null); @@ -158,6 +158,7 @@ const OrganizationProfile: FC = ({ try { const orgData: any = await getOrganization({ baseUrl, + instanceId, organizationId, }); setOrganization(orgData); @@ -180,6 +181,7 @@ const OrganizationProfile: FC = ({ await updateOrganization({ baseUrl, + instanceId, operations, organizationId, }); diff --git a/packages/react/src/components/presentation/UserProfile/UserProfile.tsx b/packages/react/src/components/presentation/UserProfile/UserProfile.tsx index 7ef8a2c19..115d49700 100644 --- a/packages/react/src/components/presentation/UserProfile/UserProfile.tsx +++ b/packages/react/src/components/presentation/UserProfile/UserProfile.tsx @@ -65,7 +65,7 @@ export type UserProfileProps = Omit = ({...rest}: UserProfileProps): ReactElement => { - const {baseUrl} = useAsgardeo(); + const {baseUrl, instanceId} = useAsgardeo(); const {profile, flattenedProfile, schemas, onUpdateProfile} = useUser(); const {t} = useTranslation(); @@ -75,7 +75,7 @@ const UserProfile: FC = ({...rest}: UserProfileProps): ReactEl setError(null); try { - const response: User = await updateMeProfile({baseUrl, payload}); + const response: User = await updateMeProfile({baseUrl, instanceId, payload}); onUpdateProfile(response); } catch (caughtError: unknown) { let message: string = t('user.profile.update.generic.error'); diff --git a/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts b/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts index b5ceafdb9..be72704d7 100644 --- a/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts +++ b/packages/react/src/contexts/Asgardeo/AsgardeoContext.ts @@ -83,6 +83,10 @@ export type AsgardeoContextProps = { */ requestAll: (requestConfigs?: HttpRequestConfig[]) => Promise[]>; }; + /** + * Instance ID for multi-instance support. + */ + instanceId: number; isInitialized: boolean; /** * Flag indicating whether the SDK is working in the background. @@ -165,6 +169,7 @@ const AsgardeoContext: Context = createContext null, requestAll: () => null, }, + instanceId: 0, isInitialized: false, isLoading: true, isSignedIn: false, diff --git a/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx b/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx index 4131ea646..392b754f1 100644 --- a/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx +++ b/packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx @@ -570,6 +570,7 @@ const AsgardeoProvider: FC> = ({ request, requestAll, }, + instanceId, isInitialized: isInitializedSync, isLoading: isLoadingSync, isSignedIn: isSignedInSync, @@ -615,6 +616,7 @@ const AsgardeoProvider: FC> = ({ signUp, clearSession, reInitialize, + instanceId, ], );