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
- All projects deleted
Hello, from the appwrite console last week I re-activated some of my old project and published them, yesterday I checked and none of the apps were working, now ...
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...
- My account got banned without obvious re...
Hello, I’m a normal user of Appwrite. Today I found my account was banned suddenly, and I can’t log in normally. I have only been doing normal development and...