BobcatProgrammer
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
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...