I have a react application that checks user authentication on render with account.get() and redirects to login page if error code is 401
It has a sign in button to execute await account.createOAuth2Session('google', 'http://localhost:5173', 'http://localhost:5173/failed');
After logging out cookies are still set but account.get() returns 401 which makes sense After completing oauth process from google appwrite redirects to the homepage which makes a request to account.get() but this request does not have any cookies set and returns 401 so the user is constantly redirected to login page.
Waiting for a second and reloading the page resolves the issue. How do I handle this in a better way?
^ request to account.get()
You could have the new tab send a message to the original tab: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
We do something like this in flutter web: https://github.com/appwrite/playground-for-flutter/blob/ad30fb232a223e118c9429ac1df75f856b6a1d9d/web/auth.html#L6
Recommended threads
- Issue with downloading large files (40GB...
Hi everyone! I am using the latest Appwrite 1.8.0 version on my self-hosted server. I successfully uploaded a large ZIP archive (~40GB) using the chunked uploa...
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...
- Beginner Unity game
In tutorial creator get new words, but i dont I dont lnow what problem https://www.youtube.com/watch?v=vQY4jsho1nQ 11:17