After creating an OAuth2 session using createOAuth2Session in Appwrite, the session is created successfully in the cloud console, but when I try to fetch user details on the frontend, account.get() returns null. My web platform is properly connected. What could be causing this and how can I fix it?
code: export async function loader(){ try { return await account.get(); } catch(e) { console.log(e); } }
Exception: User (role: guests) missing scopes (["account"])
This happens because your frontend isn’t getting the Appwrite session cookie, so account.get() runs as a guest. Usually caused by wrong domain settings or calling it server-side. I can help fix it are you running account.get() in the browser or in a server loader?
in the browser
Got it since it’s in the browser, the session cookie still isn’t being set. That usually means the OAuth redirect URL or Web Platform domain in Appwrite is slightly wrong. I can help you fix it quickly if you want feel free to message me and I’ll walk you through the exact setup and get the session working properly. @Sriram
ya Can you say me the exact setup
I am running my application in http://localhost:5173
If you’re on http://localhost:5173, then Appwrite must have that exact URL added in the Web Platform even a small mismatch breaks the session cookie. I can help you check your platform settings and OAuth redirect URLs so the cookie starts working. Just send me a message and I’ll sort it out with you.
Recommended threads
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...