Web Developer
I am getting this error when I am trying to see if a User is currently logged into a session.
I am using Next14 with Typescript.
I am using client-side functions for both the Account creation and the SignUp page. (If the user is signed in already and goes to sign up, it should just route them to their account page.)
// inside of my SignUp page.tsxconst getSession = () => { // this is where the error is getting thrown account.get().then((res) => { setSession(res); }).catch((e) => { console.log(e); }) }
useEffect(() => { getSession();
if (session) { router.push("/my-account") } }, []);I am a little confused on how the account/user scopes work when youre trying to check for a logged in user that is not logged in?