AppwriteException: User (role: guests) missing scope (account) How do i solve this issue
- 0
- React Native
- Auth
- Databases
- Web

Please how do i solve this issue?
Below is my code
export const createUser = async (username, email, password) => { try { const newAccount = await account.create( ID.unique(), email, password, username );
if (!newAccount) throw Error;
const avatarUrl = avatars.getInitials(username);
await databases.createDocument(
config.databaseId,
config.userCollectionId,
ID.unique(),
{
accountId: newAccount.$id,
email: email,
username: username,
avatar: avatarUrl,
}
);
await signIn({ email, password });
return { status: true };
} catch (error) { console.log(error); } };
export const signIn = async ({ email, password }) => { try { const session = await account.createEmailPasswordSession(email, password); if (!session) throw Error("Failed to create session");
return { status: true };
} catch (error) { throw Error(error); } };
export const getCurrentUser = async () => { try { const user = await account.get(); console.log(user.$id);
if (!user) return null;
const result = await getUser({ accountId: user.$id });
if (!result) return null;
return result;
} catch (error) { throw error; } };
export const getUser = async ({ accountId }) => { console.log(accountId);
try { const currentUser = await databases.listDocuments( config.databaseId, config.userCollectionId, [Query.equal("accountId", accountId)] );
if (!currentUser) return null;
return currentUser.documents[0];
} catch (error) { throw error; } };
NB : I have tried all the solutions outlined but no positive outcome.

Check permission is correctly handled in your dashboard, you have given correct perms for the database collection

I've done that already but still getting the error

I get this error countless times, because I always forget to assign right perms to any/ miss to configure something. I too stuck with appwrite + react native, upload file to bucket for profile photo isn't working, and no one is replying to my support ticket.
Recommended threads
- Appwrite realtime stopped working all of...
In our production environment, Appwrite Realtime suddenly stopped working and no updates are coming through , can you confirm if there are any known issues?
- Create platform and can not connect ping
I created a new platform but when I cloned the source, I didn't see the lib/... folder, only env. Then I created a .env file and added those files, then pinged ...
- 2 Columns still processing since yesterd...
Hey o/ Yesterday (around <t:1758045600:f>), I created a database and added several columns to it. After about 15 minutes, most of the "processing" tags disappe...
