diff --git a/src/integrations/LibraCart/LibraCartAccess.tsx b/src/integrations/LibraCart/LibraCartAccess.tsx index 738ce13..d2a3433 100644 --- a/src/integrations/LibraCart/LibraCartAccess.tsx +++ b/src/integrations/LibraCart/LibraCartAccess.tsx @@ -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;