@passkeyme/react-auth 2.2.4 → 2.2.5

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.js CHANGED
@@ -6687,6 +6687,8 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
6687
6687
  };
6688
6688
  // Proceed with redirect after auth completion
6689
6689
  const proceedWithRedirect = async () => {
6690
+ // Clean URL immediately to prevent effect re-run with stale URL params
6691
+ window.history.replaceState({}, document.title, window.location.pathname);
6690
6692
  setTimeout(async () => {
6691
6693
  const currentUser = state.authenticatedUser || user;
6692
6694
  if (onSuccess && currentUser) {
@@ -6701,8 +6703,7 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
6701
6703
  }
6702
6704
  }
6703
6705
  else {
6704
- // Clean URL and redirect to success page
6705
- window.history.replaceState({}, document.title, window.location.pathname);
6706
+ // Redirect to success page
6706
6707
  window.location.href = successRedirect;
6707
6708
  }
6708
6709
  }, 100);