Local appwrite run functions --user-id not generating x-appwrite-user-jwt (self-hosted)
- 0
- Self Hosted
- Functions
Hi, I'm running into an issue when testing Appwrite functions locally with user impersonation.
I'm using a self-hosted Appwrite instance and running functions locally with the CLI: appwrite run functions --function-id <FUNCTION_ID> --user-id <USER_ID>
The function runs correctly, but the impersonation headers are not generated.
Inside the function I logged the headers and I'm getting: log(JSON.stringify({ userId: req.headers['x-appwrite-user-id'] ?? null, hasUserJwt: Boolean(req.headers['x-appwrite-user-jwt']), hasApiKey: Boolean(req.headers['x-appwrite-key']), }, null, 2)); So: { "userId": "6978b6b8003822478082", "hasUserJwt": false, "hasApiKey": false }
The CLI prints the following warning: Dynamic API key not generated. Header x-appwrite-key will not be set. Reason: <email> (role: users) missing scopes (["users.read"])
However the function does have the required scopes in appwrite.config.json, including: "scopes": [ "users.read" ]
Other CLI commands work normally: appwrite push functions appwrite pull deployments etc.
So the CLI login seems valid.
Am I missing something in my setup, or is there any additional configuration required for local user impersonation on self-hosted Appwrite?
Recommended threads
- Selfhosted Github App installation
I've followed this guide: https://appwrite.io/docs/advanced/self-hosting/configuration/version-control to connect GitHub to my self-hosted Appwrite instance (1....
- User ID case sensitivity
I see that through REST (and SDK as well), getting a user is not case sensitive. And even though documentation does not clearly state that it is, the wording "V...
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...