Back

Keep getting this error

  • 0
  • Web
Ishmeet
2 May, 2024, 18:32
TypeScript
Uncaught (in promise) AppwriteException: User (role: guests) missing scope (account)

I'm trying to test something related to JWT session this is what i wrote on the web client end

TypeScript
const client = new Client();
  client
    .setEndpoint('http://localhost/v1')
    .setProject('<my-id>')

  const account = new Account(client);

  async function login() {
    await account.createEmailPasswordSession("testing1@gmail.com", "test@123")
  }

  async function jwt() {
    await account.createJWT();
  }

  async function testing() {
    const acc = await account.get();
    console.log(acc)
  }

  login();
  jwt();
  testing();

  setTimeout(() => {
    testing();
  }, 15000);

I've set the session timeout limit to 10 sec to and set timeout to 15sec to see what I want to check the problem is after 15sec have passed I keep running into the error I posted above any fix for this?

TL;DR
Developers are encountering an error stating "User (role: guests) missing scope (account)" when testing JWT session. The error occurs due to insufficient scope permissions. To resolve this, ensure that the user role has 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