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
- Bug in relational table
I potential found a bug or is there something I am missing? I created 2 tables. User and Coins User has a one to one relation to Coins When attempting to cre...
- Server API Key
Hi, I have a self-hosted Appwrite instance and I can’t quite figure out how to create a server-side API that lets me automate the creation of projects. The only...
- Locked out of account
Hey guys, I have a paid account and have been locked out. Apologies for using this method, but I'm getting no response via the contact us page. I had a old do...