Skip to content
Back

User (role: guests) missing scope (users.write)

  • 0
  • Auth
  • Web
mcjo3324
14 Feb, 2025, 09:34

Hello,

I have this error and this is my code :

TypeScript
const client = new Client()
  .setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
  .setProject(process.env.APPWRITE_PROJECT_ID_KEY)
  .setKey(process.env.APPWRITE_API_KEY);

const users = new Users(client);
let user;

if (bodyJson.email) {
  user = await users.updateEmail(params.id, bodyJson.email);
}

if (bodyJson.name) {
  user = await users.updateName(params.id, bodyJson.name);
}

return {
  code: 200,
  response: {
    user,
  },
};

I have already checked my 3 env variables, they are good. My bodyJson.name is good too and same for my params.id

TL;DR
Developers are encountering an error due to missing scope "users.write" for the "guests" role. Ensure the mentioned role has the required scope.
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