@asgardeo/react 0.14.2 → 0.14.4

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 CHANGED
@@ -8517,8 +8517,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
8517
8517
  );
8518
8518
  }
8519
8519
  case import_browser50.EmbeddedFlowComponentTypeV2.Timer: {
8520
- const timerConfig = component.config || {};
8521
- const textTemplate = timerConfig.text || "Time remaining: {time}";
8520
+ const textTemplate = resolve(component.label) || "Time remaining: {time}";
8522
8521
  const timeoutMs = Number(options.additionalData?.["stepTimeout"]) || 0;
8523
8522
  const expiresIn = timeoutMs > 0 ? Math.max(0, Math.floor((timeoutMs - Date.now()) / 1e3)) : 0;
8524
8523
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FlowTimer_default, { expiresIn, textTemplate }, key);
@@ -11507,6 +11506,7 @@ var BaseInviteUser = ({
11507
11506
  const [touchedFields, setTouchedFields] = (0, import_react71.useState)({});
11508
11507
  const [inviteLink, setInviteLink] = (0, import_react71.useState)();
11509
11508
  const [inviteLinkCopied, setInviteLinkCopied] = (0, import_react71.useState)(false);
11509
+ const [emailSent, setEmailSent] = (0, import_react71.useState)(false);
11510
11510
  const [isFormValid, setIsFormValid] = (0, import_react71.useState)(true);
11511
11511
  const initializationAttemptedRef = (0, import_react71.useRef)(false);
11512
11512
  const handleError = (0, import_react71.useCallback)(
@@ -11618,6 +11618,9 @@ var BaseInviteUser = ({
11618
11618
  setInviteLink(inviteLinkValue);
11619
11619
  onInviteLinkGenerated?.(inviteLinkValue, response.flowId);
11620
11620
  }
11621
+ if (response.data?.additionalData?.["emailSent"] === "true") {
11622
+ setEmailSent(true);
11623
+ }
11621
11624
  if (response.flowStatus === "ERROR") {
11622
11625
  handleError(response);
11623
11626
  return;
@@ -11669,6 +11672,7 @@ var BaseInviteUser = ({
11669
11672
  setTouchedFields({});
11670
11673
  setInviteLink(void 0);
11671
11674
  setInviteLinkCopied(false);
11675
+ setEmailSent(false);
11672
11676
  initializationAttemptedRef.current = false;
11673
11677
  }, []);
11674
11678
  (0, import_react71.useEffect)(() => {
@@ -11760,6 +11764,7 @@ var BaseInviteUser = ({
11760
11764
  const { title, subtitle } = extractHeadings(components);
11761
11765
  const componentsWithoutHeadings = filterHeadings(components);
11762
11766
  const isInviteGenerated = !!inviteLink;
11767
+ const isEmailSent = emailSent;
11763
11768
  const renderProps = {
11764
11769
  components,
11765
11770
  copyInviteLink,
@@ -11771,6 +11776,7 @@ var BaseInviteUser = ({
11771
11776
  handleSubmit,
11772
11777
  inviteLink,
11773
11778
  inviteLinkCopied,
11779
+ isEmailSent,
11774
11780
  isInviteGenerated,
11775
11781
  isLoading,
11776
11782
  isValid: isFormValid,
@@ -11796,6 +11802,15 @@ var BaseInviteUser = ({
11796
11802
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Description, { children: apiError.message })
11797
11803
  ] }) }) });
11798
11804
  }
11805
+ if (isInviteGenerated && isEmailSent) {
11806
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
11807
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invite Email Sent!" }) }),
11808
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default.Content, { children: [
11809
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default, { variant: "success", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Description, { children: "An invitation email has been sent successfully. The user can complete their registration using the link in the email." }) }),
11810
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
11811
+ ] })
11812
+ ] });
11813
+ }
11799
11814
  if (isInviteGenerated && inviteLink) {
11800
11815
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
11801
11816
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),