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 Cloud project is paused and nev...
Hi Appwrite Team & Community, I am facing a problem with one of my Appwrite Cloud projects which seems to be identical to the other cases of "paused projects" ...
- Timed out waiting for runtime error
execution id 6a3e0791978712d81ee0 im having issue with appwrite function runtime performance. even after 4gbram and cpu same function sometimes completes in a...
- Project auto-blocked after load testing ...
Hi team π My project has been automatically blocked with the message: "Project is currently blocked β Access to this project is restricted. Contact support if...