So I create jwt on the frontend for the user:
const promise = account.createJWT();
How do I retrieve it on the backend?
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('[PROJECT_ID]') // Your project ID
.setJWT('eyJJ9.eyJ...886ca'); // Your secret JSON Web Token
from client send it to server
is JWT attached to every req?
No
If a user is execution the function then any time is doing so a fresh JWT will be sent to you inside the APPWRITE_FUNCTION_JWT variable.
Like so
.setJWT(req.variables.APPWRITE_FUNCTION_JWT ?? '')
Check here for more details: https://appwrite.io/docs/functions#functionVariables
Recommended threads
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- Local appwrite run functions --user-id n...
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 ...
- How to Display File in Web?
I'm trying to use Appwrite's Storage to store images and display them in my app, however when I use the `getFileView`, `getFileDownload` or `getFilePreview` met...