
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
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
