Skip to content
Back

Facing this Exception User (role: guests) missing scopes (["account"])

  • 0
  • Auth
  • Web
  • Cloud
Sriram
19 Nov, 2025, 09:54

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"])

TL;DR
Developers experiencing an issue with the Appwrite session cookie not being set properly in the browser, leading to the "User missing scopes" error. This is likely due to incorrect OAuth redirect URLs or domain settings. Make sure the URLs match exactly. Check if the account.get() function is being called correctly in the frontend code and ensure that the web platform configuration is accurate. Contact Appwrite support for assistance in resolving this issue.
Oliva
19 Nov, 2025, 10:05

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?

Sriram
19 Nov, 2025, 10:06

in the browser

Oliva
19 Nov, 2025, 10:07

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

Sriram
19 Nov, 2025, 10:08

ya Can you say me the exact setup

Sriram
19 Nov, 2025, 10:09

I am running my application in http://localhost:5173

Oliva
19 Nov, 2025, 10:13

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.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more