im trying to subscribe only to user related documents. Document security is enabled. But I get any updates.
I recive also documents from other user
nextjs:
const { client } = getClientSideServices();
return client.subscribe(
`databases.${appwriteConfig.databaseId}.collections.${collectionId}.documents`,
(response) => {
console.log('Events get for :', collectionId, response);
callback(response);
}
);
and
export function getClientSideServices() {
const client = new Client()
.setEndpoint(appwriteConfig.endpoint)
.setProject(appwriteConfig.projectId);
const sessionCookie = getCookie('session');
if (sessionCookie) {
console.log('Session-Cookie found, last Session:', sessionCookie.substring(0, 10) + '...');
client.setSession(sessionCookie);
} else {
console.warn('No Session-Cookie found!');
}
return {
account: new Account(client),
databases: new Databases(client),
storage: new Storage(client),
teams: new Teams(client),
client,
};
}
permissions on collection settings:
permissions on document settings:
I followed also this tutorial. It doesnt helped
I checked also dev tools on browser. the user is null. Is that the reason? If yes, how can we fix it?
Recommended threads
- Invalid token passed in the request
Hello, I have an issue using updateMagicURLSession. I send the email using sendMagicLink, which works fine. When i click the link in the email i get the invali...
- functions domain error
I cannot set up the domain for function Iβm trying to add the domain api.example.com I can only use Cloudflare as the DNS provider because my domain provider do...
- Storage Bucket Permissions
Hey folks, when enabling CRUD on the bucket level for the role any, should the bucket be accessible when using a session client?