I'm trying to implement a simple login system in my application. I can create users and user sessions successfully, but when i try to delete either the current session or all sessions, or get a list of all sessions i get the above error. Here is the code I'm running:
// appwrite. config.ts
import * as sdk from "node-appwrite"
const client = new sdk.Client(); client .setEndpoint(process.env.NEXT_PUBLIC_ENDPOINT!) .setProject(process.env.NEXT_PUBLIC_PROJECT_ID!) .setKey(process.env.NEXT_PUBLIC_API_KEY!);
export const databases = new sdk.Databases(client); export const storage = new sdk.Storage(client); export const messaging = new sdk.Messaging(client); export const account = new sdk.Account(client); export const users = new sdk.Users(client);
// Code that fails: try { const result = await account.createEmailPasswordSession( loginData.email, loginData.password, ); // session is created successfully if (result) { console.log("result", result) try { const list = await account.listSessions(); console.log(list) } catch (e: unknown) { if(e instanceof AppwriteException) { console.error(e); // AppwriteException: app.668e66460027825557a8@service.cloud.appwrite.io (role: applications) missing scope (account) // I get the same error from account.deleteSession("current") and account.deleteSessions() } } }
Recommended threads
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...
- 500 simultaneous OAuth logins from the s...
Hi, I'd like to ask about rate limiting around Google OAuth login on Appwrite Cloud. **OVERVIEW** Service type: A PWA (web app) for members of a university clu...
- Suspicious access pattern detected when ...
Hello, I am having trouble restoring my project. In the past it worked with no problems, but today I get an error "Suspicious access pattern detected". How can ...