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
Issue: After creating an OAuth2 session in Appwrite, the user role 'guests' is missing the necessary scopes (["account"]), causing account.get() to return null when fetching user details on the frontend.
Solution: Update the user's role to include the required scopes for account access in Appwrite to resolve this issue.