@asgardeo/react 0.14.3 → 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.
@@ -78,6 +78,10 @@ export interface BaseInviteUserRenderProps {
78
78
  * Whether the invite link was copied.
79
79
  */
80
80
  inviteLinkCopied: boolean;
81
+ /**
82
+ * Whether the invite email was sent successfully.
83
+ */
84
+ isEmailSent: boolean;
81
85
  /**
82
86
  * Whether the invite link has been generated (admin flow complete).
83
87
  */
package/dist/index.js CHANGED
@@ -11468,6 +11468,7 @@ var BaseInviteUser = ({
11468
11468
  const [touchedFields, setTouchedFields] = useState21({});
11469
11469
  const [inviteLink, setInviteLink] = useState21();
11470
11470
  const [inviteLinkCopied, setInviteLinkCopied] = useState21(false);
11471
+ const [emailSent, setEmailSent] = useState21(false);
11471
11472
  const [isFormValid, setIsFormValid] = useState21(true);
11472
11473
  const initializationAttemptedRef = useRef10(false);
11473
11474
  const handleError = useCallback14(
@@ -11579,6 +11580,9 @@ var BaseInviteUser = ({
11579
11580
  setInviteLink(inviteLinkValue);
11580
11581
  onInviteLinkGenerated?.(inviteLinkValue, response.flowId);
11581
11582
  }
11583
+ if (response.data?.additionalData?.["emailSent"] === "true") {
11584
+ setEmailSent(true);
11585
+ }
11582
11586
  if (response.flowStatus === "ERROR") {
11583
11587
  handleError(response);
11584
11588
  return;
@@ -11630,6 +11634,7 @@ var BaseInviteUser = ({
11630
11634
  setTouchedFields({});
11631
11635
  setInviteLink(void 0);
11632
11636
  setInviteLinkCopied(false);
11637
+ setEmailSent(false);
11633
11638
  initializationAttemptedRef.current = false;
11634
11639
  }, []);
11635
11640
  useEffect20(() => {
@@ -11721,6 +11726,7 @@ var BaseInviteUser = ({
11721
11726
  const { title, subtitle } = extractHeadings(components);
11722
11727
  const componentsWithoutHeadings = filterHeadings(components);
11723
11728
  const isInviteGenerated = !!inviteLink;
11729
+ const isEmailSent = emailSent;
11724
11730
  const renderProps = {
11725
11731
  components,
11726
11732
  copyInviteLink,
@@ -11732,6 +11738,7 @@ var BaseInviteUser = ({
11732
11738
  handleSubmit,
11733
11739
  inviteLink,
11734
11740
  inviteLinkCopied,
11741
+ isEmailSent,
11735
11742
  isInviteGenerated,
11736
11743
  isLoading,
11737
11744
  isValid: isFormValid,
@@ -11757,6 +11764,15 @@ var BaseInviteUser = ({
11757
11764
  /* @__PURE__ */ jsx83(Alert_default.Description, { children: apiError.message })
11758
11765
  ] }) }) });
11759
11766
  }
11767
+ if (isInviteGenerated && isEmailSent) {
11768
+ return /* @__PURE__ */ jsxs33(Card_default, { className: cx23(className, styles.card), variant, children: [
11769
+ /* @__PURE__ */ jsx83(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx83(Card_default.Title, { level: 2, className: styles.title, children: "Invite Email Sent!" }) }),
11770
+ /* @__PURE__ */ jsxs33(Card_default.Content, { children: [
11771
+ /* @__PURE__ */ jsx83(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx83(Alert_default.Description, { children: "An invitation email has been sent successfully. The user can complete their registration using the link in the email." }) }),
11772
+ /* @__PURE__ */ jsx83("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx83(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
11773
+ ] })
11774
+ ] });
11775
+ }
11760
11776
  if (isInviteGenerated && inviteLink) {
11761
11777
  return /* @__PURE__ */ jsxs33(Card_default, { className: cx23(className, styles.card), variant, children: [
11762
11778
  /* @__PURE__ */ jsx83(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx83(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),