So I followed the tutorial here https://appwrite.io/docs/tutorials/sveltekit-ssr-auth/step-1 with my self-hosted instance on v1.5.3. Login works nicely. However if I then try to use the logged in user to read docs from a collection i get an error:
TypeScript
code: 401,
type: 'general_unauthorized_scope',
response: {
message: 'user@example.com (role: users) missing scope (collections.read)',
code: 401,
type: 'general_unauthorized_scope',
version: '1.5.3'
}
}```
I am using the user session client as created in the example here https://github.com/appwrite/demos-for-svelte/blob/74be81a18142be31f7a818f2e58693b2682909ff/server-side-rendering/src/lib/server/appwrite.ts#L18 to call the `db.listDocuments`
I explicitly made sure the collection is set to allow CRUD for `Any` and `Role: Users`. Still I get the error. Is this a bug or am I not supposed to use `node-appwrite` on server-side with a user session client?
TL;DR
Developers followed a tutorial for SSR with Svelte and Appwrite v1.5.3, successfully implemented user login but encountered a 401 error when trying to read docs from a collection. The error indicates missing scope 'collections.read' for the logged-in user. The collection settings seem correct, so the issue might be with using `node-appwrite` on the server-side with a user session client. Further troubleshooting is recommended.Recommended threads
- type generation on same columns in table
is there way to prevent this ? or only need to update column name like table prefix?
- Unable to send verification email
Hi! I’m trying to access my project on Appwrite Cloud (fra.cloud.appwrite.io), but I keep getting this popup saying: “To continue using Appwrite Cloud, please...
- Custom Topic sent from Function (with sc...
Can I send a message on a custom topic? So clients can subscribe to them?