
I keep getting this error: AppwriteException: User (role: guests) missing scopes (["teams.read"])
at new AppwriteException (/usr/local/server/src/function/node_modules/node-appwrite/dist/client.mjs:8:5)
at <anonymous> (/usr/local/server/src/function/node_modules/node-appwrite/dist/client.mjs:294:17)
at processTicksAndRejections (:12:39)
Here is the scope for the function:
"sessions.write",
"users.read",
"users.write",
"teams.read",
"teams.write",
"databases.read",
"tables.read",
"collections.read",
"columns.read",
"attributes.read",
"rows.read",
"documents.read",
"rows.write",
"documents.write",
"execution.write"
],```
Here is how I am calling teams:
```const client = new Client()
.setEndpoint(Bun.env["APPWRITE_FUNCTION_API_ENDPOINT"]!)
.setProject(Bun.env["APPWRITE_FUNCTION_PROJECT_ID"]!)
.setKey(req.headers['x-appwrite-key'] ?? '');
const tableDB = new TablesDB(client);
const users = new Users(client);
const session = await users.createSession({
userId: incomingData.user_id,
});
const clientSession = new Client()
.setEndpoint(Bun.env["APPWRITE_FUNCTION_API_ENDPOINT"]!)
.setProject(Bun.env["APPWRITE_FUNCTION_PROJECT_ID"]!)
.setSession(session.$id);
console.log("Checking teams on: ", session.$id);
const teams = new Teams(clientSession);
// Get all teams for the current user
const teamsData = await teams.list();```
I do the same thing in another function with the same scope and access without an issue.

You're using the clientSession
Client object for the Teams call, not the client
Client object.
Recommended threads
- My cookie don't have a value
I'm trying to authenticate an user with the python 12.0.0 server SDK. The function `create_email_password_session ` returns a dictionary in which the secret key...
- I got arhcived project, but I didn't it
Hello, help me please, I can't use my main project in appwrite
- Queries Length Error.
Hi All, I am having a issues across my app with how i am getting data, and just wanted to check if this was an issues with the new changes on appwrite over the...
