#Appwrite Cloud Function - User ID Mismatch Issue

12 messages · Page 1 of 1 (latest)

worn forum
#

how are you executing the function?

dire bear
#

I am trying to add permission to the user who is deleting a document. I am comparing the user id with the owner of the document, and if they are the same, the user should have permission to delete the document. When I try to log the user id from the server, it is not the same as my user id.

#

IN authorization, my user id is different. What is the problem?

dire bear
#

After I execute the function, the document wont be deleted even thought the owner of the document is the same as my user id. Should I use another logic?

worn forum
dire bear
#

By sending the json payload after clicking the buttin execute in appwrite

worn forum
dire bear
#

how can i solve this?

#

what should I do in order for the function_user_id to be the same as the id of the user in the project

hot sundial
dire bear
#

is there any other way to get the user id on the server side?

hot sundial