-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathAsgardeoProvider.tsx
More file actions
712 lines (631 loc) · 23.1 KB
/
AsgardeoProvider.tsx
File metadata and controls
712 lines (631 loc) · 23.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
/**
* Copyright (c) 2025-2026, 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 {
AllOrganizationsApiResponse,
AsgardeoRuntimeError,
generateFlattenedUserProfile,
OIDCDiscoveryApiResponse,
Organization,
SignInOptions,
User,
UserProfile,
getBrandingPreference,
GetBrandingPreferenceConfig,
BrandingPreference,
IdToken,
getActiveTheme,
Platform,
extractUserClaimsFromIdToken,
EmbeddedSignInFlowResponseV2,
TokenResponse,
createPackageComponentLogger,
} from '@asgardeo/browser';
import {FC, RefObject, PropsWithChildren, ReactElement, useEffect, useMemo, useRef, useState, useCallback} from 'react';
import AsgardeoContext from './AsgardeoContext';
import AsgardeoReactClient from '../../AsgardeoReactClient';
import useBrowserUrl from '../../hooks/useBrowserUrl';
import {AsgardeoReactConfig} from '../../models/config';
import BrandingProvider from '../Branding/BrandingProvider';
import FlowProvider from '../Flow/FlowProvider';
import FlowMetaProvider from '../FlowMeta/FlowMetaProvider';
import I18nProvider from '../I18n/I18nProvider';
import OrganizationProvider from '../Organization/OrganizationProvider';
import ThemeProvider from '../Theme/ThemeProvider';
import UserProvider from '../User/UserProvider';
const logger: ReturnType<typeof createPackageComponentLogger> = createPackageComponentLogger(
'@asgardeo/react',
'AsgardeoProvider',
);
/**
* Props interface of {@link AsgardeoProvider}
*/
export type AsgardeoProviderProps = AsgardeoReactConfig;
const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({
afterSignInUrl = window.location.origin,
afterSignOutUrl = window.location.origin,
baseUrl: initialBaseUrl,
clientId,
children,
scopes,
preferences,
signInUrl,
signUpUrl,
organizationHandle,
applicationId,
signInOptions,
syncSession,
instanceId = 0,
organizationChain,
...rest
}: PropsWithChildren<AsgardeoProviderProps>): ReactElement => {
const reRenderCheckRef: RefObject<boolean> = useRef(false);
const asgardeo: AsgardeoReactClient = useMemo(() => new AsgardeoReactClient(instanceId), [instanceId]);
const {hasAuthParams, hasCalledForThisInstance} = useBrowserUrl();
const [user, setUser] = useState<any | null>(null);
const [currentOrganization, setCurrentOrganization] = useState<Organization | null>(null);
const [isSignedInSync, setIsSignedInSync] = useState<boolean>(false);
const [isInitializedSync, setIsInitializedSync] = useState<boolean>(false);
const [isLoadingSync, setIsLoadingSync] = useState<boolean>(true);
const [myOrganizations, setMyOrganizations] = useState<Organization[]>([]);
const [userProfile, setUserProfile] = useState<UserProfile | null>(null);
const [baseUrl, setBaseUrl] = useState<string>(initialBaseUrl);
const [config, setConfig] = useState<AsgardeoReactConfig>({
afterSignInUrl,
afterSignOutUrl,
applicationId,
baseUrl,
clientId,
organizationChain,
organizationHandle,
scopes,
signInOptions,
signInUrl,
signUpUrl,
syncSession,
...rest,
});
const [isUpdatingSession, setIsUpdatingSession] = useState<boolean>(false);
const [wellKnown, setWellKnown] = useState<OIDCDiscoveryApiResponse | null>(null);
// Branding state
const [brandingPreference, setBrandingPreference] = useState<BrandingPreference | null>(null);
const [isBrandingLoading, setIsBrandingLoading] = useState<boolean>(false);
const [brandingError, setBrandingError] = useState<Error | null>(null);
const [hasFetchedBranding, setHasFetchedBranding] = useState<boolean>(false);
useEffect(() => {
setBaseUrl(initialBaseUrl);
// Reset branding state when baseUrl changes
if (initialBaseUrl !== baseUrl) {
setHasFetchedBranding(false);
setBrandingPreference(null);
setBrandingError(null);
}
}, [initialBaseUrl, baseUrl]);
useEffect(() => {
(async (): Promise<void> => {
await asgardeo.initialize(config);
const initializedConfig: AsgardeoReactConfig = await asgardeo.getConfiguration();
setConfig(initializedConfig);
setWellKnown(await asgardeo.getDiscoveryResponse());
})();
}, []);
async function updateSession(): Promise<void> {
try {
// Set flag to prevent loading state tracking from interfering
setIsUpdatingSession(true);
setIsLoadingSync(true);
let resolvedBaseUrl: string = baseUrl;
const decodedToken: IdToken = await asgardeo.getDecodedIdToken();
// If there's a `user_org` claim in the ID token,
// Treat this login as a organization login.
if (decodedToken?.['user_org']) {
resolvedBaseUrl = `${(await asgardeo.getConfiguration()).baseUrl}/o`;
setBaseUrl(resolvedBaseUrl);
}
// TEMPORARY: Asgardeo V2 platform does not support SCIM2, Organizations endpoints yet.
// Tracker: https://github.com/asgardeo/javascript/issues/212
if (config.platform === Platform.AsgardeoV2) {
const claims: Record<string, any> = extractUserClaimsFromIdToken(decodedToken);
setUser(claims);
setUserProfile({
flattenedProfile: claims as User,
profile: claims as User,
schemas: [],
});
} else {
// Check if user profile fetching is enabled (default: true)
const shouldFetchUserProfile: boolean = preferences?.user?.fetchUserProfile !== false;
if (shouldFetchUserProfile) {
try {
const fetchedUser: User = await asgardeo.getUser({baseUrl: resolvedBaseUrl});
setUser(fetchedUser);
} catch (error) {
// TODO: Add an error log.
}
try {
const fetchedUserProfile: UserProfile = await asgardeo.getUserProfile({baseUrl: resolvedBaseUrl});
setUserProfile(fetchedUserProfile);
} catch (error) {
// TODO: Add an error log.
}
}
// Check if organization fetching is enabled (default: true)
const shouldFetchOrganizations: boolean = preferences?.user?.fetchOrganizations !== false;
if (shouldFetchOrganizations) {
try {
const fetchedOrganization: Organization = await asgardeo.getCurrentOrganization();
setCurrentOrganization(fetchedOrganization);
} catch (error) {
// TODO: Add an error log.
}
try {
const fetchedMyOrganizations: Organization[] = await asgardeo.getMyOrganizations();
setMyOrganizations(fetchedMyOrganizations);
} catch (error) {
// TODO: Add an error log.
}
}
}
// CRITICAL: Update sign-in status BEFORE setting loading to false
// This prevents the race condition where ProtectedRoute sees isLoading=false but isSignedIn=false
const currentSignInStatus: boolean = await asgardeo.isSignedIn();
setIsSignedInSync(currentSignInStatus);
} catch (error) {
// TODO: Add an error log.
} finally {
// Clear the flag and set final loading state
setIsUpdatingSession(false);
setIsLoadingSync(asgardeo.isLoading());
}
}
async function signIn(...args: any): Promise<User | EmbeddedSignInFlowResponseV2> {
// Check if this is a V2 embedded flow request BEFORE calling signIn
// This allows us to skip session checks entirely for V2 flows
const arg1: any = args[0];
const isV2FlowRequest: boolean =
config.platform === Platform.AsgardeoV2 &&
typeof arg1 === 'object' &&
arg1 !== null &&
('executionId' in arg1 || 'applicationId' in arg1);
try {
if (!isV2FlowRequest) {
setIsUpdatingSession(true);
setIsLoadingSync(true);
}
const response: User | EmbeddedSignInFlowResponseV2 = await asgardeo.signIn(...args);
if (isV2FlowRequest || (response && typeof response === 'object' && 'flowStatus' in response)) {
return response;
}
if (await asgardeo.isSignedIn()) {
await updateSession();
}
return response as User;
} catch (error) {
throw new AsgardeoRuntimeError(
`Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
'asgardeo-signIn-Error',
'react',
'An error occurred while trying to sign in.',
);
} finally {
if (!isV2FlowRequest) {
setIsUpdatingSession(false);
setIsLoadingSync(asgardeo.isLoading());
}
}
}
/**
* Try signing in when the component is mounted.
*/
useEffect(() => {
// React 18.x Strict.Mode has a new check for `Ensuring reusable state` to facilitate an upcoming react feature.
// https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state
// This will remount all the useEffects to ensure that there are no unexpected side effects.
// When react remounts the signIn hook of the AuthProvider, it will cause a race condition. Hence, we have to
// prevent the re-render of this hook as suggested in the following discussion.
// https://github.com/reactwg/react-18/discussions/18#discussioncomment-795623
if (reRenderCheckRef.current) {
return;
}
reRenderCheckRef.current = true;
(async (): Promise<void> => {
// User is already authenticated. Skip...
const isAlreadySignedIn: boolean = await asgardeo.isSignedIn();
// Start auto-refresh with a soft failure.
const scheduleAutoRefresh = async (): Promise<void> => {
try {
await asgardeo.startAutoRefreshToken();
} catch (error) {
logger.warn('Failed to schedule automatic token refresh.', error);
}
};
// Restore session state and kick off the refresh timer.
const resumeSession = async (): Promise<void> => {
await updateSession();
await scheduleAutoRefresh();
};
if (isAlreadySignedIn) {
await resumeSession();
}
// The access token may have expired while the refresh token is still valid.
// Attempt a silent refresh — startAutoRefreshToken() calls refreshAccessToken()
// immediately when timeUntilRefresh <= 0, then re-check sign-in status.
await scheduleAutoRefresh();
if (await asgardeo.isSignedIn()) {
await resumeSession();
return;
}
const currentUrl: URL = new URL(window.location.href);
const hasAuthParamsResult: boolean =
hasAuthParams(currentUrl, afterSignInUrl) && hasCalledForThisInstance(currentUrl, instanceId ?? 0);
const isV2Platform: boolean = config.platform === Platform.AsgardeoV2;
if (hasAuthParamsResult) {
try {
if (isV2Platform) {
// For V2 platform, check if this is an embedded flow or traditional OAuth
const urlParams: URLSearchParams = currentUrl.searchParams;
const code: string | null = urlParams.get('code');
const executionIdFromUrl: string | null = urlParams.get('executionId');
const storedExecutionId: string | null = sessionStorage.getItem('asgardeo_execution_id');
// If there's a code and no executionId, exchange OAuth code for tokens
if (code && !executionIdFromUrl && !storedExecutionId) {
await signIn();
}
} else {
// If non-V2 platform, use traditional OAuth callback handling
await signIn(
{callOnlyOnRedirect: true},
// authParams?.authorizationCode,
// authParams?.sessionState,
// authParams?.state,
);
}
// setError(null);
} catch (error) {
throw new AsgardeoRuntimeError(
`Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
'asgardeo-signIn-Error',
'react',
'An error occurred while trying to sign in.',
);
}
} else {
// TODO: Add a debug log to indicate that the user is not signed in
}
})();
}, []);
/**
* Check if the user is signed in and update the state accordingly.
* This will also set an interval to check for the sign-in status every second
* until the user is signed in.
*/
useEffect(() => {
let interval: NodeJS.Timeout;
(async (): Promise<void> => {
try {
const status: boolean = await asgardeo.isSignedIn();
setIsSignedInSync(status);
if (!status) {
interval = setInterval(async () => {
const newStatus: boolean = await asgardeo.isSignedIn();
if (newStatus) {
setIsSignedInSync(true);
clearInterval(interval);
}
}, 1000);
} else {
// TODO: Add a debug log to indicate that the user is already signed in.
}
} catch (error) {
setIsSignedInSync(false);
}
})();
return (): void => {
if (interval) {
clearInterval(interval);
}
};
}, [asgardeo]);
useEffect(() => {
(async (): Promise<void> => {
try {
const status: boolean = await asgardeo.isInitialized();
setIsInitializedSync(status);
} catch (error) {
setIsInitializedSync(false);
}
})();
}, [asgardeo]);
/**
* Track loading state changes from the Asgardeo client
*/
useEffect(() => {
const checkLoadingState = (): void => {
// Don't override loading state during critical session updates
if (isUpdatingSession) {
return;
}
// Don't set loading=false while auth params are in the URL and user isn't signed in yet.
// This prevents ProtectedRoute from redirecting before the sign-in effect processes the auth code.
const currentUrl: URL = new URL(window.location.href);
if (!isSignedInSync && hasAuthParams(currentUrl, afterSignInUrl)) {
return;
}
setIsLoadingSync(asgardeo.isLoading());
};
// Initial check
checkLoadingState();
// Set up an interval to check for loading state changes
const interval: NodeJS.Timeout = setInterval(checkLoadingState, 100);
return (): void => {
clearInterval(interval);
};
}, [asgardeo, isLoadingSync, isSignedInSync, isUpdatingSession]);
// Branding fetch function
const fetchBranding: () => Promise<void> = useCallback(async (): Promise<void> => {
if (!baseUrl) {
return;
}
// Prevent multiple calls if already fetching
if (isBrandingLoading) {
return;
}
setIsBrandingLoading(true);
setBrandingError(null);
try {
const getBrandingConfig: GetBrandingPreferenceConfig = {
baseUrl,
locale: preferences?.i18n?.language,
// Add other branding config options as needed
};
const brandingData: BrandingPreference = await getBrandingPreference(getBrandingConfig);
setBrandingPreference(brandingData);
setHasFetchedBranding(true);
} catch (err) {
const errorMessage: Error = err instanceof Error ? err : new Error('Failed to fetch branding preference');
setBrandingError(errorMessage);
setBrandingPreference(null);
setHasFetchedBranding(true); // Mark as fetched even on error to prevent retries
} finally {
setIsBrandingLoading(false);
}
}, [baseUrl, preferences?.i18n?.language]);
// Refetch branding function
const refetchBranding: () => Promise<void> = useCallback(async (): Promise<void> => {
setHasFetchedBranding(false); // Reset the flag to allow refetching
await fetchBranding();
}, [fetchBranding]);
// Auto-fetch branding when initialized and configured
useEffect(() => {
// TEMPORARY: Asgardeo V2 platform does not support branding preference yet.
// Tracker: https://github.com/asgardeo/javascript/issues/212
if (config.platform === Platform.AsgardeoV2) {
return;
}
// Only fetch branding when explicitly enabled via preferences.theme.inheritFromBranding
const shouldFetchBranding: boolean = preferences?.theme?.inheritFromBranding === true;
if (shouldFetchBranding && isInitializedSync && baseUrl && !hasFetchedBranding && !isBrandingLoading) {
fetchBranding();
}
}, [
preferences?.theme?.inheritFromBranding,
isInitializedSync,
baseUrl,
hasFetchedBranding,
isBrandingLoading,
fetchBranding,
]);
const signInSilently = async (options?: SignInOptions): Promise<User | boolean> => {
try {
setIsUpdatingSession(true);
setIsLoadingSync(true);
const response: User | boolean = await asgardeo.signInSilently(options);
if (await asgardeo.isSignedIn()) {
await updateSession();
}
return response;
} catch (error) {
throw new AsgardeoRuntimeError(
`Error while signing in silently: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
'asgardeo-signInSilently-Error',
'react',
'An error occurred while trying to sign in silently.',
);
} finally {
setIsUpdatingSession(false);
setIsLoadingSync(asgardeo.isLoading());
}
};
const switchOrganization = async (organization: Organization): Promise<TokenResponse | Response> => {
try {
setIsUpdatingSession(true);
setIsLoadingSync(true);
const response: TokenResponse | Response = await asgardeo.switchOrganization(organization);
if (await asgardeo.isSignedIn()) {
await updateSession();
}
return response;
} catch (error) {
throw new AsgardeoRuntimeError(
`Failed to switch organization: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,
'asgardeo-switchOrganization-Error',
'react',
'An error occurred while switching to the specified organization.',
);
} finally {
setIsUpdatingSession(false);
setIsLoadingSync(asgardeo.isLoading());
}
};
const handleProfileUpdate = (payload: User): void => {
setUser(payload);
setUserProfile((prev: UserProfile | null) => ({
...prev,
flattenedProfile: generateFlattenedUserProfile(payload, prev?.schemas),
profile: payload,
}));
};
const getDecodedIdToken: () => Promise<IdToken> = useCallback(
async (): Promise<IdToken> => asgardeo.getDecodedIdToken(),
[asgardeo],
);
const getIdToken: () => Promise<string> = useCallback(async (): Promise<string> => asgardeo.getIdToken(), [asgardeo]);
const getAccessToken: () => Promise<string> = useCallback(
async (): Promise<string> => asgardeo.getAccessToken(),
[asgardeo],
);
const request: (...args: any[]) => Promise<any> = useCallback(
async (...args: any[]): Promise<any> => asgardeo.request(...args),
[asgardeo],
);
const requestAll: (...args: any[]) => Promise<any> = useCallback(
async (...args: any[]): Promise<any> => asgardeo.requestAll(...args),
[asgardeo],
);
const exchangeToken: (exchangeConfig: any) => Promise<any> = useCallback(
async (exchangeConfig: any): Promise<any> => asgardeo.exchangeToken(exchangeConfig),
[asgardeo],
);
const signOut: (...args: any[]) => Promise<any> = useCallback(
async (...args: any[]): Promise<any> => asgardeo.signOut(...args),
[asgardeo],
);
const signUp: (...args: any[]) => Promise<any> = useCallback(
async (...args: any[]): Promise<any> => asgardeo.signUp(...args),
[asgardeo],
);
const clearSession: (...args: any[]) => Promise<any> = useCallback(
async (...args: any[]): Promise<any> => asgardeo.clearSession(...args),
[asgardeo],
);
const reInitialize: (reInitConfig: any) => Promise<any> = useCallback(
async (reInitConfig: any): Promise<any> => asgardeo.reInitialize(reInitConfig),
[asgardeo],
);
const value: any = useMemo(
() => ({
afterSignInUrl,
applicationId: config.applicationId,
baseUrl,
clearSession,
clientId,
discovery: {
wellKnown,
},
exchangeToken,
getAccessToken,
getDecodedIdToken,
getIdToken,
http: {
request,
requestAll,
},
instanceId,
isInitialized: isInitializedSync,
isLoading: isLoadingSync,
isSignedIn: isSignedInSync,
organization: currentOrganization,
organizationChain,
organizationHandle: config?.organizationHandle,
platform: config?.platform,
reInitialize,
signIn,
signInOptions,
signInSilently,
signInUrl,
signOut,
signUp,
signUpUrl,
switchOrganization,
syncSession,
user,
}),
[
applicationId,
config?.organizationHandle,
signInUrl,
signUpUrl,
afterSignInUrl,
baseUrl,
clientId,
wellKnown,
isInitializedSync,
isLoadingSync,
isSignedInSync,
currentOrganization,
signIn,
signInSilently,
user,
asgardeo,
signInOptions,
syncSession,
switchOrganization,
getDecodedIdToken,
getAccessToken,
request,
requestAll,
exchangeToken,
signOut,
signUp,
clearSession,
reInitialize,
instanceId,
organizationChain,
],
);
return (
<AsgardeoContext.Provider value={value}>
<I18nProvider preferences={preferences?.i18n}>
<FlowMetaProvider enabled={preferences?.resolveFromMeta !== false}>
<BrandingProvider
brandingPreference={brandingPreference}
isLoading={isBrandingLoading}
error={brandingError}
enabled={preferences?.theme?.inheritFromBranding === true}
refetch={refetchBranding}
>
<ThemeProvider
inheritFromBranding={preferences?.theme?.inheritFromBranding}
theme={{
...preferences?.theme?.overrides,
direction: preferences?.theme?.direction,
}}
mode={getActiveTheme(preferences?.theme?.mode)}
>
<FlowProvider>
<UserProvider profile={userProfile} onUpdateProfile={handleProfileUpdate}>
<OrganizationProvider
getAllOrganizations={async (): Promise<AllOrganizationsApiResponse> =>
asgardeo.getAllOrganizations()
}
myOrganizations={myOrganizations}
currentOrganization={currentOrganization}
onOrganizationSwitch={switchOrganization}
revalidateMyOrganizations={async (): Promise<Organization[]> => asgardeo.getMyOrganizations()}
>
{children}
</OrganizationProvider>
</UserProvider>
</FlowProvider>
</ThemeProvider>
</BrandingProvider>
</FlowMetaProvider>
</I18nProvider>
</AsgardeoContext.Provider>
);
};
export default AsgardeoProvider;