
Let's say that on the client I call a function:
TypeScript
//INSERT FUNCTION ID HERE
);```
and then on the server I have this:
export default async ({ req, res, log, error }) => {
if (req.path === "/") { const userId = req.headers['x-appwrite-user-id']; log(userId); } ... }
TypeScript
Is it guaranteed that the userId on the server is the user who triggered the function or can it be spoofed? Does it need to be validated with x-appwrite-user-jwt? I am making it so that only users can execute the function also...
TL;DR
The `x-appwrite-user-id` header can be spoofed if not validated with `x-appwrite-user-jwt`. Always validate the user ID to ensure only authorized users can execute the function.Recommended threads
- Best way to return html from cloud funct...
Right now I am return text ``` return response.text(JoinTeamHtml.successResponse(code), 200, {'Content-Type': 'text/html; charset=utf-8'}); ``` my c...
- storage.getFileDownload returns an empty...
Hi, I am using the nodejs sdk with version 22. When I run the getFileDownload method, the response is always an empty object. The getFile works, it returns the ...
- Internal curl errors has occurred within...
Hey I get this error when I wanna execute a function: Internal curl errors has occurred within the executor! Error Number: 6. Error Msg: Could not resolve host:...
