update to libracart access to pull the data from the url

This commit is contained in:
csawatzky 2025-07-18 11:01:34 -06:00
parent a0a54bee2a
commit 767ca5ef97

View file

@ -63,13 +63,21 @@ export default function LibraCartAccess() {
}
}, [teamKey, userAPI]);
// useEffect(() => {
// let code = localStorage.getItem("state");
// if (code) {
// setLibraCartCode(code);
// setOpenDialog(true);
// }
// }, [searchParams, libracartCode]);
useEffect(() => {
let code = localStorage.getItem("state");
let code = new URLSearchParams(window.location.search).get("state"); // not sure if the state is correct here i thought it should be the access_token
if (code) {
setLibraCartCode(code);
setOpenDialog(true);
}
}, [searchParams, libracartCode]);
}, [window.location]);
const validate = () => {
let invalid = false;