@passkeyme/react-auth 2.2.8 → 2.2.9
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,
|
|
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,mDA24B/B,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -6692,8 +6692,12 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
|
|
|
6692
6692
|
window.history.replaceState({}, document.title, window.location.pathname);
|
|
6693
6693
|
setTimeout(async () => {
|
|
6694
6694
|
const currentUser = state.authenticatedUser || user;
|
|
6695
|
-
|
|
6696
|
-
|
|
6695
|
+
// If custom onSuccess callback provided, use it and let parent handle navigation
|
|
6696
|
+
if (onSuccess) {
|
|
6697
|
+
if (!currentUser) {
|
|
6698
|
+
debugLog(config, "CallbackHandler", "Warning: onSuccess provided but no currentUser available");
|
|
6699
|
+
return;
|
|
6700
|
+
}
|
|
6697
6701
|
try {
|
|
6698
6702
|
const token = await auth.getAccessToken();
|
|
6699
6703
|
onSuccess(currentUser, token || "");
|
|
@@ -6702,14 +6706,18 @@ const PasskeymeCallbackHandler = ({ loadingComponent: LoadingComponent, errorCom
|
|
|
6702
6706
|
debugLog(config, "CallbackHandler", "Error getting access token:", error);
|
|
6703
6707
|
onSuccess(currentUser, "");
|
|
6704
6708
|
}
|
|
6709
|
+
return; // Don't proceed with redirect - parent handles navigation
|
|
6705
6710
|
}
|
|
6706
|
-
|
|
6711
|
+
// No custom callback - use successRedirect for navigation
|
|
6712
|
+
if (successRedirect) {
|
|
6707
6713
|
console.log("[CallbackHandler] Redirecting to success URL:", {
|
|
6708
6714
|
successRedirect,
|
|
6709
6715
|
});
|
|
6710
|
-
// For redirects, navigate to success page
|
|
6711
6716
|
window.location.href = successRedirect;
|
|
6712
6717
|
}
|
|
6718
|
+
else {
|
|
6719
|
+
debugLog(config, "CallbackHandler", "No successRedirect or onSuccess provided - user will remain on callback page");
|
|
6720
|
+
}
|
|
6713
6721
|
}, 100);
|
|
6714
6722
|
};
|
|
6715
6723
|
useEffect(() => {
|