@asgardeo/react 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +24 -18
- package/dist/cjs/index.js.map +2 -2
- package/dist/index.js +24 -18
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -2188,25 +2188,31 @@ var AsgardeoProvider = ({
|
|
|
2188
2188
|
schemas: []
|
|
2189
2189
|
});
|
|
2190
2190
|
} else {
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
setCurrentOrganization(fetchedOrganization);
|
|
2204
|
-
} catch (error) {
|
|
2191
|
+
const shouldFetchUserProfile = preferences?.user?.fetchUserProfile !== false;
|
|
2192
|
+
if (shouldFetchUserProfile) {
|
|
2193
|
+
try {
|
|
2194
|
+
const fetchedUser = await asgardeo.getUser({ baseUrl: resolvedBaseUrl });
|
|
2195
|
+
setUser(fetchedUser);
|
|
2196
|
+
} catch (error) {
|
|
2197
|
+
}
|
|
2198
|
+
try {
|
|
2199
|
+
const fetchedUserProfile = await asgardeo.getUserProfile({ baseUrl: resolvedBaseUrl });
|
|
2200
|
+
setUserProfile(fetchedUserProfile);
|
|
2201
|
+
} catch (error) {
|
|
2202
|
+
}
|
|
2205
2203
|
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2204
|
+
const shouldFetchOrganizations = preferences?.user?.fetchOrganizations !== false;
|
|
2205
|
+
if (shouldFetchOrganizations) {
|
|
2206
|
+
try {
|
|
2207
|
+
const fetchedOrganization = await asgardeo.getCurrentOrganization();
|
|
2208
|
+
setCurrentOrganization(fetchedOrganization);
|
|
2209
|
+
} catch (error) {
|
|
2210
|
+
}
|
|
2211
|
+
try {
|
|
2212
|
+
const fetchedMyOrganizations = await asgardeo.getMyOrganizations();
|
|
2213
|
+
setMyOrganizations(fetchedMyOrganizations);
|
|
2214
|
+
} catch (error) {
|
|
2215
|
+
}
|
|
2210
2216
|
}
|
|
2211
2217
|
}
|
|
2212
2218
|
const currentSignInStatus = await asgardeo.isSignedIn();
|