const user = await createSessionClient(session).account.get();
node-appwrite package can work but react-native-appwrite package cannot work.
The only different is package, the source code of the createSessionClient function is exactly the same.
In my client, which is the client using react-native-appwrite package, this error is always thrown: [AppwriteException: User (role: guests) missing scope (account)]
I even hardcoded the correct session secret and it didn't work. It threw this error: [AppwriteException: User (role: guests) missing scope (account)]
const user = await createSessionClient(hardcode_session_secret).account.get();
createSessionClient function:
`export function createSessionClient(session: string) { const client = new Client() .setSession(session) .setProject(process.env.EXPO_PUBLIC_APPWRITE_PROJECT) .setEndpoint(process.env.EXPO_PUBLIC_APPWRITE_END_POINT);
return { get account() { return new Account(client); },
get storage() {
return new Storage(client);
},
get databases() {
return new Databases(client);
},
}; }`
Recommended threads
- Cloud function deployment failures
When I run appwrite push functions, select the function I want to deploy, confirm with a YES, is starts deploying but goes into error. I need to repeat the ste...
- Failed to create function
Hey everyone 👋 I'm having an issue creating Functions on Appwrite Cloud and I'm not sure if it's a platform bug or something wrong in my project. When I try t...
- Function deployment failed: Unable to re...
Hi Appwrite team, I have been experiencing persistent errors when i attempt to push my appwrite functions. The logs on the deployment detail page on the console...