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
- All data wiped from my project
I tried starting up my app and got a 'Failed to fetch image 500' error when accessing an image. When I checked, it looks like all my data (users, images, videos...
- REACT NATIVE EXPO FILE UPLOAD ISSUE
I developed a React Native app with Expo. I'm using USB to connect my phone and everything is going great - fetching/updating/etc. However, I can't upload files...
- Does Appwrite React Native SDK Support R...
I have reviewed the doc and can I assume that since it is not an option to select over the code samples, that it is not supported?