update to libracart access to pull the data from the url
This commit is contained in:
parent
a0a54bee2a
commit
767ca5ef97
1 changed files with 10 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue