@passkeyme/react-auth 2.2.1 → 2.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PasskeymeCallbackHandler.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeCallbackHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAuLzD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,GAAG,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,wBAAwB,GAAI,sIAQtC,6BAA6B,mDAg2B/B,CAAC"}
1
+ {"version":3,"file":"PasskeymeCallbackHandler.d.ts","sourceRoot":"","sources":["../../src/components/PasskeymeCallbackHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAuLzD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,GAAG,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,wBAAwB,GAAI,sIAQtC,6BAA6B,mDAs3B/B,CAAC"}
package/dist/index.esm.js CHANGED
@@ -6717,6 +6717,12 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
6717
6717
  const code = urlParams.get("code");
6718
6718
  const error = urlParams.get("error");
6719
6719
  const errorDescription = urlParams.get("error_description");
6720
+ debugLog(config, "CallbackHandler", "Extracted from URL:", {
6721
+ token: !!token,
6722
+ code: !!code,
6723
+ error,
6724
+ errorDescription,
6725
+ });
6720
6726
  // Handle OAuth errors from the provider
6721
6727
  if (error) {
6722
6728
  const errorMessage = errorDescription || error || "Authentication failed";
@@ -6759,6 +6765,8 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
6759
6765
  showPasskeyPrompt: shouldPrompt,
6760
6766
  });
6761
6767
  debugLog(config, "CallbackHandler", "Token flow - updated state, showPasskeyPrompt:", shouldPrompt);
6768
+ // Mark callback as processed to prevent re-execution
6769
+ setCallbackProcessed(true);
6762
6770
  if (!shouldPrompt) {
6763
6771
  // Proceed with normal redirect
6764
6772
  proceedWithRedirect();
@@ -6808,6 +6816,8 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
6808
6816
  showPasskeyPrompt: shouldPrompt,
6809
6817
  });
6810
6818
  debugLog(config, "CallbackHandler", "OAuth code flow - updated state, showPasskeyPrompt:", shouldPrompt);
6819
+ // Mark callback as processed to prevent re-execution
6820
+ setCallbackProcessed(true);
6811
6821
  if (!shouldPrompt) {
6812
6822
  // Proceed with normal redirect
6813
6823
  proceedWithRedirect();
@@ -6870,7 +6880,16 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
6870
6880
  }
6871
6881
  };
6872
6882
  processCallback();
6873
- }, [callbackProcessed]); // Only depend on callbackProcessed to prevent loops
6883
+ }, [
6884
+ callbackProcessed,
6885
+ handleCallback,
6886
+ handleTokenCallback,
6887
+ onError,
6888
+ onSuccess,
6889
+ errorRedirect,
6890
+ successRedirect,
6891
+ config.debug,
6892
+ ]);
6874
6893
  // Handle auth errors from the SDK
6875
6894
  useEffect(() => {
6876
6895
  if (authError) {