@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/cjs/index.js
CHANGED
|
@@ -7244,12 +7244,12 @@ var resolveTranslationsInArray = (items, t, properties) => {
|
|
|
7244
7244
|
var resolveTranslationsInArray_default = resolveTranslationsInArray;
|
|
7245
7245
|
|
|
7246
7246
|
// src/utils/v2/flowTransformer.ts
|
|
7247
|
-
var transformComponents = (response, t) => {
|
|
7247
|
+
var transformComponents = (response, t, resolveTranslations = true) => {
|
|
7248
7248
|
if (!response?.data?.meta?.components) {
|
|
7249
7249
|
return [];
|
|
7250
7250
|
}
|
|
7251
7251
|
const components = response.data.meta.components;
|
|
7252
|
-
return resolveTranslationsInArray_default(components, t);
|
|
7252
|
+
return resolveTranslations ? resolveTranslationsInArray_default(components, t) : components;
|
|
7253
7253
|
};
|
|
7254
7254
|
var extractErrorMessage = (error, t, defaultErrorKey = "errors.flow.generic") => {
|
|
7255
7255
|
if (error && typeof error === "object" && error.failureReason) {
|
|
@@ -7264,14 +7264,14 @@ var checkForErrorResponse = (response, t, defaultErrorKey = "errors.flow.generic
|
|
|
7264
7264
|
return null;
|
|
7265
7265
|
};
|
|
7266
7266
|
var normalizeFlowResponse = (response, t, options = {}) => {
|
|
7267
|
-
const { throwOnError = true, defaultErrorKey = "errors.flow.generic" } = options;
|
|
7267
|
+
const { throwOnError = true, defaultErrorKey = "errors.flow.generic", resolveTranslations = true } = options;
|
|
7268
7268
|
const errorMessage = checkForErrorResponse(response, t, defaultErrorKey);
|
|
7269
7269
|
if (errorMessage && throwOnError) {
|
|
7270
7270
|
throw response;
|
|
7271
7271
|
}
|
|
7272
7272
|
return {
|
|
7273
7273
|
flowId: response.flowId,
|
|
7274
|
-
components: transformComponents(response, t)
|
|
7274
|
+
components: transformComponents(response, t, resolveTranslations)
|
|
7275
7275
|
};
|
|
7276
7276
|
};
|
|
7277
7277
|
|
|
@@ -7732,7 +7732,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7732
7732
|
if (handleRedirection(response)) {
|
|
7733
7733
|
return;
|
|
7734
7734
|
}
|
|
7735
|
-
const { flowId, components: components2 } = normalizeFlowResponse(response, t
|
|
7735
|
+
const { flowId, components: components2 } = normalizeFlowResponse(response, t, {
|
|
7736
|
+
resolveTranslations: !children
|
|
7737
|
+
});
|
|
7736
7738
|
if (flowId && components2) {
|
|
7737
7739
|
setFlowId(flowId);
|
|
7738
7740
|
setComponents(components2);
|
|
@@ -7768,7 +7770,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7768
7770
|
if (handleRedirection(response)) {
|
|
7769
7771
|
return;
|
|
7770
7772
|
}
|
|
7771
|
-
const { flowId, components: components2 } = normalizeFlowResponse(response, t
|
|
7773
|
+
const { flowId, components: components2 } = normalizeFlowResponse(response, t, {
|
|
7774
|
+
resolveTranslations: !children
|
|
7775
|
+
});
|
|
7772
7776
|
if (response.flowStatus === import_browser48.EmbeddedSignInFlowStatusV2.Error) {
|
|
7773
7777
|
console.error("[SignIn] Flow returned Error status, clearing flow state");
|
|
7774
7778
|
clearFlowState();
|
|
@@ -9123,7 +9127,8 @@ var BaseSignUpContent2 = ({
|
|
|
9123
9127
|
if (response?.data) {
|
|
9124
9128
|
try {
|
|
9125
9129
|
const { components } = normalizeFlowResponse(response, t, {
|
|
9126
|
-
defaultErrorKey: "components.signUp.errors.generic"
|
|
9130
|
+
defaultErrorKey: "components.signUp.errors.generic",
|
|
9131
|
+
resolveTranslations: !children
|
|
9127
9132
|
});
|
|
9128
9133
|
return {
|
|
9129
9134
|
...response,
|
|
@@ -9138,7 +9143,7 @@ var BaseSignUpContent2 = ({
|
|
|
9138
9143
|
}
|
|
9139
9144
|
return response;
|
|
9140
9145
|
},
|
|
9141
|
-
[t]
|
|
9146
|
+
[t, children]
|
|
9142
9147
|
);
|
|
9143
9148
|
const extractFormFields = (0, import_react62.useCallback)(
|
|
9144
9149
|
(components) => {
|