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.Recommended threads
- Function executions not getting logged b...
Hello, I have just upgraded on a self-hosted 1.8.1 to 1.9.0 and I have a strange bug where my functions are no longer showing executions in the console, howeve...
- Appwrite 1.9 Local Console Login Issue A...
I've installed Appwrite 1.9 locally through the web wizard. When I try to log in to the console, I get the following. Any suggestion?
- > [Bug] Infinite loading on Auth /securi...
Hello everyone! 👋 I need some help with an issue I'm facing after a recent upgrade. **Context:** I just upgraded my Appwrite instance from version **1.8.1**...