@asgardeo/react 0.6.22 → 0.6.23
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 +13 -8
- package/dist/cjs/index.js.map +2 -2
- package/dist/index.js +13 -8
- package/dist/index.js.map +2 -2
- package/dist/utils/v2/flowTransformer.d.ts +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7159,12 +7159,12 @@ var resolveTranslationsInArray = (items, t, properties) => {
|
|
|
7159
7159
|
var resolveTranslationsInArray_default = resolveTranslationsInArray;
|
|
7160
7160
|
|
|
7161
7161
|
// src/utils/v2/flowTransformer.ts
|
|
7162
|
-
var transformComponents = (response, t) => {
|
|
7162
|
+
var transformComponents = (response, t, resolveTranslations = true) => {
|
|
7163
7163
|
if (!response?.data?.meta?.components) {
|
|
7164
7164
|
return [];
|
|
7165
7165
|
}
|
|
7166
7166
|
const components = response.data.meta.components;
|
|
7167
|
-
return resolveTranslationsInArray_default(components, t);
|
|
7167
|
+
return resolveTranslations ? resolveTranslationsInArray_default(components, t) : components;
|
|
7168
7168
|
};
|
|
7169
7169
|
var extractErrorMessage = (error, t, defaultErrorKey = "errors.flow.generic") => {
|
|
7170
7170
|
if (error && typeof error === "object" && error.failureReason) {
|
|
@@ -7179,14 +7179,14 @@ var checkForErrorResponse = (response, t, defaultErrorKey = "errors.flow.generic
|
|
|
7179
7179
|
return null;
|
|
7180
7180
|
};
|
|
7181
7181
|
var normalizeFlowResponse = (response, t, options = {}) => {
|
|
7182
|
-
const { throwOnError = true, defaultErrorKey = "errors.flow.generic" } = options;
|
|
7182
|
+
const { throwOnError = true, defaultErrorKey = "errors.flow.generic", resolveTranslations = true } = options;
|
|
7183
7183
|
const errorMessage = checkForErrorResponse(response, t, defaultErrorKey);
|
|
7184
7184
|
if (errorMessage && throwOnError) {
|
|
7185
7185
|
throw response;
|
|
7186
7186
|
}
|
|
7187
7187
|
return {
|
|
7188
7188
|
flowId: response.flowId,
|
|
7189
|
-
components: transformComponents(response, t)
|
|
7189
|
+
components: transformComponents(response, t, resolveTranslations)
|
|
7190
7190
|
};
|
|
7191
7191
|
};
|
|
7192
7192
|
|
|
@@ -7654,7 +7654,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7654
7654
|
if (handleRedirection(response)) {
|
|
7655
7655
|
return;
|
|
7656
7656
|
}
|
|
7657
|
-
const { flowId, components: components2 } = normalizeFlowResponse(response, t
|
|
7657
|
+
const { flowId, components: components2 } = normalizeFlowResponse(response, t, {
|
|
7658
|
+
resolveTranslations: !children
|
|
7659
|
+
});
|
|
7658
7660
|
if (flowId && components2) {
|
|
7659
7661
|
setFlowId(flowId);
|
|
7660
7662
|
setComponents(components2);
|
|
@@ -7690,7 +7692,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7690
7692
|
if (handleRedirection(response)) {
|
|
7691
7693
|
return;
|
|
7692
7694
|
}
|
|
7693
|
-
const { flowId, components: components2 } = normalizeFlowResponse(response, t
|
|
7695
|
+
const { flowId, components: components2 } = normalizeFlowResponse(response, t, {
|
|
7696
|
+
resolveTranslations: !children
|
|
7697
|
+
});
|
|
7694
7698
|
if (response.flowStatus === EmbeddedSignInFlowStatusV2.Error) {
|
|
7695
7699
|
console.error("[SignIn] Flow returned Error status, clearing flow state");
|
|
7696
7700
|
clearFlowState();
|
|
@@ -9055,7 +9059,8 @@ var BaseSignUpContent2 = ({
|
|
|
9055
9059
|
if (response?.data) {
|
|
9056
9060
|
try {
|
|
9057
9061
|
const { components } = normalizeFlowResponse(response, t, {
|
|
9058
|
-
defaultErrorKey: "components.signUp.errors.generic"
|
|
9062
|
+
defaultErrorKey: "components.signUp.errors.generic",
|
|
9063
|
+
resolveTranslations: !children
|
|
9059
9064
|
});
|
|
9060
9065
|
return {
|
|
9061
9066
|
...response,
|
|
@@ -9070,7 +9075,7 @@ var BaseSignUpContent2 = ({
|
|
|
9070
9075
|
}
|
|
9071
9076
|
return response;
|
|
9072
9077
|
},
|
|
9073
|
-
[t]
|
|
9078
|
+
[t, children]
|
|
9074
9079
|
);
|
|
9075
9080
|
const extractFormFields = useCallback12(
|
|
9076
9081
|
(components) => {
|