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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...