hi, I am always getting this error when using OAuth google login to check if user is logged in or not.
Workflow: I have this authContext function which in useEffect/useLayoutEffect gets current session and loads user's google profile if logged in else redirects to /login page. When a user is logged in, it works fine else it throws this exception (see title).
I have tried both account.get and account.getSession('current') and still gets the same exception when user is not logged in. This doesn't only happen in useEffect or useLayoutEffect on button to get session (just for testing) and its same.
useLayoutEffect(() => {
getLoggedInGoogleUser();
}, []);
const getLoggedInGoogleUser = async () => {
try {
const hey = await account.getSession("current");
if (hey) console.log(hey);
} catch (error) {
console.log(error);
}
};
please help getting around this error.
thank you, best regards.
Recommended threads
- Project Paused Despite Daily Active Usag...
I noticed that my project was automatically **paused**, even though it is actively being used. The project is an **attendance application** that is used daily b...
- Sudden CORS Errors - Domain hasn't Chang...
I have an Appwrite project with two web apps configured, the first one has the hostname `*` and the second one I just added to test if it could fix the issue wi...
- User ID case sensitivity
I see that through REST (and SDK as well), getting a user is not case sensitive. And even though documentation does not clearly state that it is, the wording "V...