
Hello,
I was trying to access the user their own document, which was made using document security and that is working perfectly.
However, now I want to fetch the data, but it only gives me 401 errors.. Using the cookies doesn't work, creating a JWT doesn't work and the only thing that does work is using a X-Appwrite-Key, which doesn't make sense. Any help is appreciated.

My code:
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/v1/databases/databaseid/collections/collectionid/documents`, {
method: "GET",
headers: {
"Content-Type": "application/json",
"X-Appwrite-Project": `${process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID}`,
"X-Appwrite-Response-Format": "1.4.0",
},
});

The error:
{
message: 'The current user is not authorized to perform the requested action.',
code: 401,
type: 'user_unauthorized',
}

I even have my entire collection on read all..

(Postman also doesn't work fetching, FYI)

Found it.. seems that there was a relationship which the user didn't have access to..

[Solved] Unauthorized on a completely public collection
Recommended threads
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
