Hello,
I'm trying to check if my user has an active session but when i used await account.get() i have this error.
I create the session bu phone auth SMS like this:
TypeScript
const client = new Client()
.setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
.setProject(process.env.APPWRITE_PROJECT_ID_KEY);
const account = new Account(client);
const secretCode = req.bodyJson.secretCode.trim();
const userId = req.bodyJson.userId.trim();
const secret = secretCode;
const session = await account.createSession(userId, secret);
And to check if the user is logged, like this :
TypeScript
const client = new Client()
.setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
.setProject(process.env.APPWRITE_PROJECT_ID_KEY);
const account = new Account(client);
await account.get();
TL;DR
Developers are getting "User (role: guests) missing scope (account)" error when trying to check if a user has an active session using `await account.get()`. The issue arises due to missing permissions. To resolve this, make sure the user has the necessary account scope permissions.Recommended threads
- Hosted a webite on appwrite 2 days ago, ...
I dont really know why its down, everything looks fine, the deployments and all
- OAuth login not working on deployed app ...
Hey there, I've been dealing with an issue where I cannot use OAuth on my deployed app - locally everything works fine. I am using react-router in Framework Mo...
- Bug on Updating User Limit
I’ve encountered a bug in the Appwrite Cloud UI when attempting to update the user limit to 0. My goal is to disable public registration while still allowing e...