@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/index.js
CHANGED
|
@@ -2072,25 +2072,31 @@ var AsgardeoProvider = ({
|
|
|
2072
2072
|
schemas: []
|
|
2073
2073
|
});
|
|
2074
2074
|
} else {
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
setCurrentOrganization(fetchedOrganization);
|
|
2088
|
-
} catch (error) {
|
|
2075
|
+
const shouldFetchUserProfile = preferences?.user?.fetchUserProfile !== false;
|
|
2076
|
+
if (shouldFetchUserProfile) {
|
|
2077
|
+
try {
|
|
2078
|
+
const fetchedUser = await asgardeo.getUser({ baseUrl: resolvedBaseUrl });
|
|
2079
|
+
setUser(fetchedUser);
|
|
2080
|
+
} catch (error) {
|
|
2081
|
+
}
|
|
2082
|
+
try {
|
|
2083
|
+
const fetchedUserProfile = await asgardeo.getUserProfile({ baseUrl: resolvedBaseUrl });
|
|
2084
|
+
setUserProfile(fetchedUserProfile);
|
|
2085
|
+
} catch (error) {
|
|
2086
|
+
}
|
|
2089
2087
|
}
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2088
|
+
const shouldFetchOrganizations = preferences?.user?.fetchOrganizations !== false;
|
|
2089
|
+
if (shouldFetchOrganizations) {
|
|
2090
|
+
try {
|
|
2091
|
+
const fetchedOrganization = await asgardeo.getCurrentOrganization();
|
|
2092
|
+
setCurrentOrganization(fetchedOrganization);
|
|
2093
|
+
} catch (error) {
|
|
2094
|
+
}
|
|
2095
|
+
try {
|
|
2096
|
+
const fetchedMyOrganizations = await asgardeo.getMyOrganizations();
|
|
2097
|
+
setMyOrganizations(fetchedMyOrganizations);
|
|
2098
|
+
} catch (error) {
|
|
2099
|
+
}
|
|
2094
2100
|
}
|
|
2095
2101
|
}
|
|
2096
2102
|
const currentSignInStatus = await asgardeo.isSignedIn();
|