
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
- Auth Error
"use client"; import { useEffect } from "react"; import { getSessionCookie } from "@/actions/auth"; import { createBrowserSessionClient } from "@/lib/appwrite-...
- Cannot connect to SMTP in AppWrite - set...
This used to work and then at some point it stopped. One thing that happened in that time was moving my application to Vercel. I have read on another thread t...
- Prevent modifying specific attributes
How do I prevent user to only to be able to modify some of the attributes. Document level security gives full access to update whole document, what are the wor...
