@privy-io/react-auth 1.47.1 → 1.47.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/index.d.ts CHANGED
@@ -1983,6 +1983,16 @@ interface PrivyInterface {
1983
1983
  * @returns Promise for the MFA code submission.
1984
1984
  */
1985
1985
  submit: (mfaMethod: MfaMethod, mfaCode: string) => Promise<void>;
1986
+ /**
1987
+ * Cancel the MFA flow for the current user. If there is no pending MFA verification,
1988
+ * this function is a no-op.
1989
+ *
1990
+ * Call this method instead of `submit` when a user has been prompted for
1991
+ * MFA but decides to exit the flow.
1992
+ *
1993
+ * @returns void.
1994
+ */
1995
+ cancel: () => void;
1986
1996
  /**
1987
1997
  * Prompts a user to send a transaction using their embedded wallet.
1988
1998
  *
@@ -2036,17 +2046,23 @@ declare function useWallets(): UseWalletsInterface;
2036
2046
  *
2037
2047
  * @returns init - starts the MFA verification flow
2038
2048
  * @returns submit - completes the MFA verification flow
2049
+ * @returns cancel - cancels the MFA verification flow
2039
2050
  *
2040
2051
  * @example
2041
2052
  * // MFA flow
2042
2053
  *
2043
2054
  * const MFAModal = ({ mfaMethods, isOpen, setIsOpen }: Props) => {
2044
- * const {init, submit} = useMfa();
2055
+ * const {init, submit, cancel} = useMfa();
2045
2056
  * const [selectedMethod, setSelectedMethod] = useState(null)
2046
2057
  * const [mfaCode, setMfaCode] = useState('')
2047
2058
  *
2059
+ * const handleClose = () => {
2060
+ * cancel();
2061
+ * setIsOpen(false);
2062
+ * };
2063
+ *
2048
2064
  * return (
2049
- * <Modal isOpen={isOpen} onClose={() => setIsOpen(false)}>
2065
+ * <Modal isOpen={isOpen} onClose={handleClose}>
2050
2066
  * // Capture the user's MFA code
2051
2067
  * {selectedMethod && (
2052
2068
  * <button
@@ -2106,6 +2122,7 @@ declare function useWallets(): UseWalletsInterface;
2106
2122
  declare function useMfa(): {
2107
2123
  init: (mfaMethod: "sms" | "totp") => Promise<void>;
2108
2124
  submit: (mfaMethod: "sms" | "totp", mfaCode: string) => Promise<void>;
2125
+ cancel: () => void;
2109
2126
  };
2110
2127
 
2111
2128
  /**