@asgardeo/react 0.16.1 → 0.16.2
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 +5 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/index.js +21 -21
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
generateFlattenedUserProfile as generateFlattenedUserProfile2,
|
|
9
9
|
getBrandingPreference,
|
|
10
10
|
getActiveTheme,
|
|
11
|
-
Platform as
|
|
11
|
+
Platform as Platform4,
|
|
12
12
|
extractUserClaimsFromIdToken as extractUserClaimsFromIdToken2
|
|
13
13
|
} from "@asgardeo/browser";
|
|
14
14
|
import { useEffect as useEffect6, useMemo as useMemo7, useRef as useRef2, useState as useState8, useCallback as useCallback8 } from "react";
|
|
@@ -1106,7 +1106,7 @@ var FlowProvider = ({
|
|
|
1106
1106
|
var FlowProvider_default = FlowProvider;
|
|
1107
1107
|
|
|
1108
1108
|
// src/contexts/FlowMeta/FlowMetaProvider.tsx
|
|
1109
|
-
import { FlowMetaType, getFlowMetaV2 } from "@asgardeo/browser";
|
|
1109
|
+
import { FlowMetaType, getFlowMetaV2, Platform as Platform2 } from "@asgardeo/browser";
|
|
1110
1110
|
import { TranslationBundleConstants } from "@asgardeo/i18n";
|
|
1111
1111
|
import { useCallback as useCallback3, useEffect as useEffect2, useRef, useState as useState3 } from "react";
|
|
1112
1112
|
|
|
@@ -1165,7 +1165,7 @@ var FlowMetaProvider = ({
|
|
|
1165
1165
|
children,
|
|
1166
1166
|
enabled = true
|
|
1167
1167
|
}) => {
|
|
1168
|
-
const { baseUrl, applicationId } = useAsgardeo_default();
|
|
1168
|
+
const { baseUrl, applicationId, platform } = useAsgardeo_default();
|
|
1169
1169
|
const i18nContext = useI18n_default();
|
|
1170
1170
|
const [meta, setMeta] = useState3(null);
|
|
1171
1171
|
const [isLoading, setIsLoading] = useState3(false);
|
|
@@ -1173,7 +1173,7 @@ var FlowMetaProvider = ({
|
|
|
1173
1173
|
const [pendingLanguage, setPendingLanguage] = useState3(null);
|
|
1174
1174
|
const hasFetchedRef = useRef(false);
|
|
1175
1175
|
const fetchFlowMeta = useCallback3(async () => {
|
|
1176
|
-
if (!enabled) {
|
|
1176
|
+
if (!enabled || platform !== Platform2.AsgardeoV2) {
|
|
1177
1177
|
setMeta(null);
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
@@ -1191,10 +1191,10 @@ var FlowMetaProvider = ({
|
|
|
1191
1191
|
} finally {
|
|
1192
1192
|
setIsLoading(false);
|
|
1193
1193
|
}
|
|
1194
|
-
}, [enabled, baseUrl, applicationId, i18nContext?.currentLanguage]);
|
|
1194
|
+
}, [enabled, platform, baseUrl, applicationId, i18nContext?.currentLanguage]);
|
|
1195
1195
|
const switchLanguage = useCallback3(
|
|
1196
1196
|
async (language) => {
|
|
1197
|
-
if (!enabled) return;
|
|
1197
|
+
if (!enabled || platform !== Platform2.AsgardeoV2) return;
|
|
1198
1198
|
setIsLoading(true);
|
|
1199
1199
|
setError(null);
|
|
1200
1200
|
try {
|
|
@@ -1221,7 +1221,7 @@ var FlowMetaProvider = ({
|
|
|
1221
1221
|
setIsLoading(false);
|
|
1222
1222
|
}
|
|
1223
1223
|
},
|
|
1224
|
-
[enabled, baseUrl, applicationId, i18nContext]
|
|
1224
|
+
[enabled, platform, baseUrl, applicationId, i18nContext]
|
|
1225
1225
|
);
|
|
1226
1226
|
useEffect2(() => {
|
|
1227
1227
|
if (pendingLanguage && i18nContext?.setLanguage) {
|
|
@@ -1593,7 +1593,7 @@ var OrganizationProvider_default = OrganizationProvider;
|
|
|
1593
1593
|
|
|
1594
1594
|
// src/contexts/Theme/ThemeProvider.tsx
|
|
1595
1595
|
import {
|
|
1596
|
-
Platform as
|
|
1596
|
+
Platform as Platform3
|
|
1597
1597
|
} from "@asgardeo/browser";
|
|
1598
1598
|
|
|
1599
1599
|
// src/contexts/Theme/v1/ThemeProvider.tsx
|
|
@@ -1939,7 +1939,7 @@ var ThemeProvider3 = ({
|
|
|
1939
1939
|
mode
|
|
1940
1940
|
}) => {
|
|
1941
1941
|
const { platform } = useAsgardeo_default();
|
|
1942
|
-
if (platform ===
|
|
1942
|
+
if (platform === Platform3.AsgardeoV2) {
|
|
1943
1943
|
const v2Props = { theme };
|
|
1944
1944
|
return /* @__PURE__ */ jsx8(ThemeProvider_default2, { ...v2Props, children });
|
|
1945
1945
|
}
|
|
@@ -2063,7 +2063,7 @@ var AsgardeoProvider = ({
|
|
|
2063
2063
|
resolvedBaseUrl = `${(await asgardeo.getConfiguration()).baseUrl}/o`;
|
|
2064
2064
|
setBaseUrl(resolvedBaseUrl);
|
|
2065
2065
|
}
|
|
2066
|
-
if (config.platform ===
|
|
2066
|
+
if (config.platform === Platform4.AsgardeoV2) {
|
|
2067
2067
|
const claims = extractUserClaimsFromIdToken2(decodedToken);
|
|
2068
2068
|
setUser(claims);
|
|
2069
2069
|
setUserProfile({
|
|
@@ -2103,7 +2103,7 @@ var AsgardeoProvider = ({
|
|
|
2103
2103
|
}
|
|
2104
2104
|
async function signIn(...args) {
|
|
2105
2105
|
const arg1 = args[0];
|
|
2106
|
-
const isV2FlowRequest = config.platform ===
|
|
2106
|
+
const isV2FlowRequest = config.platform === Platform4.AsgardeoV2 && typeof arg1 === "object" && arg1 !== null && ("flowId" in arg1 || "applicationId" in arg1);
|
|
2107
2107
|
try {
|
|
2108
2108
|
if (!isV2FlowRequest) {
|
|
2109
2109
|
setIsUpdatingSession(true);
|
|
@@ -2144,7 +2144,7 @@ var AsgardeoProvider = ({
|
|
|
2144
2144
|
}
|
|
2145
2145
|
const currentUrl = new URL(window.location.href);
|
|
2146
2146
|
const hasAuthParamsResult = hasAuthParams(currentUrl, afterSignInUrl) && hasCalledForThisInstance(currentUrl, instanceId ?? 0);
|
|
2147
|
-
const isV2Platform = config.platform ===
|
|
2147
|
+
const isV2Platform = config.platform === Platform4.AsgardeoV2;
|
|
2148
2148
|
if (hasAuthParamsResult) {
|
|
2149
2149
|
try {
|
|
2150
2150
|
if (isV2Platform) {
|
|
@@ -2260,7 +2260,7 @@ var AsgardeoProvider = ({
|
|
|
2260
2260
|
await fetchBranding();
|
|
2261
2261
|
}, [fetchBranding]);
|
|
2262
2262
|
useEffect6(() => {
|
|
2263
|
-
if (config.platform ===
|
|
2263
|
+
if (config.platform === Platform4.AsgardeoV2) {
|
|
2264
2264
|
return;
|
|
2265
2265
|
}
|
|
2266
2266
|
const shouldFetchBranding = preferences?.theme?.inheritFromBranding !== false;
|
|
@@ -3667,7 +3667,7 @@ var OrganizationContext2 = ({
|
|
|
3667
3667
|
var OrganizationContext_default2 = OrganizationContext2;
|
|
3668
3668
|
|
|
3669
3669
|
// src/components/presentation/auth/SignIn/BaseSignIn.tsx
|
|
3670
|
-
import { Platform as
|
|
3670
|
+
import { Platform as Platform5 } from "@asgardeo/browser";
|
|
3671
3671
|
|
|
3672
3672
|
// src/components/presentation/auth/SignIn/v1/BaseSignIn.tsx
|
|
3673
3673
|
import {
|
|
@@ -8975,7 +8975,7 @@ var BaseSignIn_default2 = BaseSignIn2;
|
|
|
8975
8975
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
8976
8976
|
var BaseSignIn3 = (props) => {
|
|
8977
8977
|
const { platform } = useAsgardeo_default();
|
|
8978
|
-
if (platform ===
|
|
8978
|
+
if (platform === Platform5.AsgardeoV2) {
|
|
8979
8979
|
return /* @__PURE__ */ jsx69(BaseSignIn_default2, { ...props });
|
|
8980
8980
|
}
|
|
8981
8981
|
return /* @__PURE__ */ jsx69(BaseSignIn_default, { ...props });
|
|
@@ -8984,7 +8984,7 @@ var BaseSignIn_default3 = BaseSignIn3;
|
|
|
8984
8984
|
|
|
8985
8985
|
// src/components/presentation/auth/SignIn/SignIn.tsx
|
|
8986
8986
|
import {
|
|
8987
|
-
Platform as
|
|
8987
|
+
Platform as Platform6
|
|
8988
8988
|
} from "@asgardeo/browser";
|
|
8989
8989
|
|
|
8990
8990
|
// src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
@@ -9733,7 +9733,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9733
9733
|
window.location.href = url.toString();
|
|
9734
9734
|
}
|
|
9735
9735
|
};
|
|
9736
|
-
if (platform ===
|
|
9736
|
+
if (platform === Platform6.AsgardeoV2) {
|
|
9737
9737
|
return /* @__PURE__ */ jsx71(
|
|
9738
9738
|
SignIn_default,
|
|
9739
9739
|
{
|
|
@@ -9768,7 +9768,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9768
9768
|
var SignIn_default2 = SignIn2;
|
|
9769
9769
|
|
|
9770
9770
|
// src/components/presentation/auth/SignUp/BaseSignUp.tsx
|
|
9771
|
-
import { Platform as
|
|
9771
|
+
import { Platform as Platform7 } from "@asgardeo/browser";
|
|
9772
9772
|
|
|
9773
9773
|
// src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
9774
9774
|
import {
|
|
@@ -11507,7 +11507,7 @@ var BaseSignUp_default2 = BaseSignUp2;
|
|
|
11507
11507
|
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
11508
11508
|
var BaseSignUp3 = (props) => {
|
|
11509
11509
|
const { platform } = useAsgardeo_default();
|
|
11510
|
-
if (platform ===
|
|
11510
|
+
if (platform === Platform7.AsgardeoV2) {
|
|
11511
11511
|
return /* @__PURE__ */ jsx80(BaseSignUp_default2, { ...props });
|
|
11512
11512
|
}
|
|
11513
11513
|
return /* @__PURE__ */ jsx80(BaseSignUp_default, { ...props });
|
|
@@ -11515,7 +11515,7 @@ var BaseSignUp3 = (props) => {
|
|
|
11515
11515
|
var BaseSignUp_default3 = BaseSignUp3;
|
|
11516
11516
|
|
|
11517
11517
|
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
11518
|
-
import { Platform as
|
|
11518
|
+
import { Platform as Platform8 } from "@asgardeo/browser";
|
|
11519
11519
|
|
|
11520
11520
|
// src/components/presentation/auth/SignUp/v1/SignUp.tsx
|
|
11521
11521
|
import {
|
|
@@ -11639,7 +11639,7 @@ var SignUp_default2 = SignUp2;
|
|
|
11639
11639
|
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
11640
11640
|
var SignUp3 = (props) => {
|
|
11641
11641
|
const { platform } = useAsgardeo_default();
|
|
11642
|
-
if (platform ===
|
|
11642
|
+
if (platform === Platform8.AsgardeoV2) {
|
|
11643
11643
|
return /* @__PURE__ */ jsx83(SignUp_default2, { ...props });
|
|
11644
11644
|
}
|
|
11645
11645
|
return /* @__PURE__ */ jsx83(SignUp_default, { ...props });
|