const presenceID = ID.unique();
setPID(presenceID);
const presence = await presences.upsert({
presenceId: presenceID,
status: "online",
});
returns this in network
code: 401
message: "The current user is not authorized to perform the requested action."
type: "user_unauthorized"
version: "1.9.5"
Have you added the presence API scope in the API key settings?
Two things can make it happen
- You upserted the presence before with a read only permission.
- You forgot to add correct scopes
Im using default permissions, and how do I check scopes cuz i believe its setup right but not 100% sure
Everything is client sided so I dont have any api key
Are you authenticated? I mean do you have an active session? Before creating a presence for the user, the user must be authenticated
yeah, Even of I have the session and reload the page so the user is definitely logged in before hand it still does that
Are you able to get the presence? If no? Then try to use a server SDK And check the permission once
Ok, so it's randomly working now, which is weird because nothing changed
I guess, you set the wrong permission TTL expired and a new presence upserted with default perms
Again if it happens, make a get/list and share the permissions it's having And if it's not coming with client SDK Please use the server side with api key for grabbing the presence perms and share here
Yeah, thats what im thinking
Recommended threads
- Appwrite Sites: ERR_TOO_MANY_REDIRECTS o...
So, my domain was working perfectly fine with Vercel. I was using cloudflare CDN (still am) but CNAME was DNS-only. I switched over to appwrite, CNAME is still ...
- Charged after Downgrade
I downgraded from the pro plan last month, but itβs still trying to charge my card this month and my account has been restricted
- Sydney Cloud Sites: App Git deployment a...
Project ID: rentwize-db The app Site fails after the build completes with a missing build archive error. Site id: app Framework: TanStack Start SSR Output dir...