What i'm doing is the following. Users can add other users as friends. For this, I have a friends collection (user1, user2, pending). The user calls this function and passes his own userid and a unique friends code as json to the function. What im wondering is, what stops another user from adding users for other users if he stole their userid?
The function is executable by logged in users only, but how could I check that the person who called the function, is the person he/she pretends to be with the provided userId in the json payload?
Is there a way to grab the user id backend side?
Yep! Refer to https://appwrite.io/docs/functions#functionVariables
Recommended threads
- Cannot create cloud function due to this...
As I try to deploy a new function to Github I get this error message: ``` Unable to clone code repository: fatal: ' ' is not a valid branch name hint: See `man ...
- How to use TS for creating appwrite func...
I was making a few appwrite functions but on doing the appwrite init setup process i always got main.js. Is there any way i can use TS?
- Synchronous Function Execution Timed Out...
Hi Appwrite team 👋 I’m facing a synchronous function execution timeout issue on Appwrite Cloud and would appreciate some guidance. I executed this function u...