
Hello, I'm having a problem with Appwrite. When I try to retrieve the logged in user information via the API, I get the following error: AppwriteException: User (role: guests) missing scope (account).
export const getCurrentUser = async () => { try { const sessions = await account.listSessions(); if (sessions.total === 0) { throw new Error('Aucune session active pour cet utilisateur.'); }
const currentAccount = await account.get();
if (!currentAccount)
throw new Error('Impossible de récupérer le compte actuel.');
const currentUser = await databases.listDocuments(
databaseId,
userCollectionId,
[Query.equal('accountId', currentAccount.$id)]
);
if (!currentUser)
throw new Error(
"Impossible de récupérer les informations de l'utilisateur."
);
return currentUser.documents[0];
} catch (error) { console.log("Erreur lors de la récupération de l'utilisateur :", error); throw new Error("Erreur lors de la récupération de l'utilisateur"); } };

There's a general problem with the database right now. Have you checked this?
Recommended threads
- Realtime Ui Dialogue
hi, is there a way ofdisable this dialogue that appers in my UI when we are listening for realtime events
- Email Verification Email
Hi everyone, I’m currently experiencing an issue with the email verification functionality. When I trigger the verification, the request returns a valid respon...
- Persistent 401 Unauthorized on all authe...
Hello, I'm facing a critical 401 Unauthorized error on my admin panel app and have exhausted all debugging options. The Problem: When my React app on localhos...
