Skip to content
Back

(role: applications) missing scope (account)

  • 0
  • Self Hosted
  • Auth
Korbs
22 Mar, 2025, 06:57

In the Server-Side Rendering Astro template, I'm currently trying to get it to work where the user can update their account.

I've added an input field where they can update their name, but when submitting it, I get the following error:

TypeScript
02:53:01 [watch] src/pages/account.astro
02:53:03 [ERROR] app.67de538f000787f352da@service.localhost (role: applications) missing scope (account)
  Stack trace:
    at Client.call (/home/korbs/demos-for-astro/server-side-rendering/node_modules/node-appwrite/lib/client.js:206:15)
    [...] See full stack trace in the browser, or rerun with --verbose.

The following code was added to `src/pages/account.astro`: ```jsx

... if (Astro.request.method === "POST") { const data = await Astro.request.formData(); const name = data.get("name") as string; const { account } = createAdminClient(); await account.updateName(name); return Astro.redirect("/account?=username_updated"); } ...

...

<section> <p>Change name:</p> <form method="POST"> <input style="background: #1c1c21;border: 1px #2c2c30 solid;padding: 6px 12px;border-radius: 6px;" id="name" name="name"/> <button class="button is-secondary is-full-width" type="submit">Update Username</button> </form> </section> ... ```

The API key I used as access to all scopes.

TL;DR
Developers are encountering a missing scope (account) error when trying to update a user's account name in the Astro template. The issue lies in the API key lacking necessary permissions. To solve this, ensure the API key has access to the 'account' 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