I'm using an api key with all the permissions to create a client. This client is then being used to get the 'current' session:
const client = new Client() .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!) .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!) .setKey(process.env.NEXT_APPWRITE_SECRET!);
const account = new Account(client);
const session = await account.getSession('current'); This returns an error:
response: {
message: 'app.___.cloud.appwrite.io (role: applications) missing scope (account)',
code: 401,
type: 'general_unauthorized_scope',
version: '1.6.1'
}
Before this is executed, I'm creating a session when logging in the user and in this code, im executing it when attempting to logout the user. I'm 100% sure im using the correct API key so i have no idea why its saying its unauthorised. someone please help
(role: applications) missing scope (account) Please Help
Recommended threads
- How do I change the endpoint from localh...
I have been working on a project locally for a while and now I want to make it live, but can’t find where to change it
- What is the context parameter in a Appwr...
Hi there, I am new to Appwrite, and am trying to make a database storing a number associated with the userId. Here is my code. Function call(Javascript) cons...
- alter auth after it is created
I have an auth created with users, I created it to test the logic and now want to add fields. Is there a way I can add fields to an Auth that has existing users...