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
- HTTP POST to function returning "No Appw...
Hi everyone, I’m running into an issue with my self-hosted Appwrite instance. I’ve set up my environment variables (APPWRITE_FUNCTION_PROJECT_ID, APPWRITE_FUNC...
- Can't add dart 3.5 runtime
Modified the `.env` to enable dart 3.5 runtime on my self-hosted instance but still can't find the runtime when creating a new function. I manually pulled the i...
- How to verify an user using AppWrite Fun...
I have seen similar questions but none whose solutions serve me. I have a function to verify a user with their secret and their id: https://blahblah.appwrite.gl...