Skip to content
Back

401: User (role: guests) missing scope (account)

  • 0
  • Auth
  • Web
  • Cloud
Seroga88i
22 Jul, 2025, 17:18

Hello guys,

I have a nuxt application where I use the package "nuxt-appwrite": "^1.2.0",

Now I want to login with email and password with this code:

TypeScript
async login(email: string, password: string){
      const { account } = useAppwrite()
      this.loading = true;
      this.loginError = false;
      try {
        this.session = await account.createEmailPasswordSession(email, password);
        this.account = await account.get();
        this.loading = false;
      } catch (error) {
        this.loginError = true;
        this.loginErrorMessage = error instanceof AppwriteException ? error.message : 'An error occurred. Please try again later.';
        this.loading = false;
      }
    },

But I get the error User (role: guests) missing scope (account) which is actually strange as the createEmailPasswordSession request works fine and I get a session but the next request fails. Attached is the screenshot where you can see the session informations and the appwriteException and another screenshot shows the request header.

Please let me know what I am doing wrong. Kind regards

TL;DR
Developers are encountering a `User (role: guests) missing scope (account)` error when using the nuxt-appwrite package. The `createEmailPasswordSession` request works fine, but the subsequent request fails. To resolve this issue, ensure that the appropriate scopes are set for the user role in the account.
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