I am creating a function that will validate the jwt that comes in the headers(x-appwrite-user-jwt), and then perform some db operation.
I am using node-18 to write the cloud functions, I am thinking of using jsonwebtoken to validate the JWT, but I can't seem to find the SECRET of the JWT that appwrite uses to sign.
How do I set SECRET for the appwrite to use in JWT.
the best way to validate the JWT token is to do:
client.setJWT(token);
const account = new Account(client);
let isValid = false;
try {
const user = account.get();
isValid = true;
catch (e) {
context.log(e.toString());
}
Great, Thank you so much.
[SOLVED ]Validate JWT in cloud functions
[SOLVED] Validate JWT in cloud functions
Recommended threads
- Can't deploy SERVER "Because of Internal...
Is there a problem with SGP Server right? Everytime I deploy a site it says Internal Server Error?
- Repository directory size should be less...
Whenever I create a function i get the error above. Is there a way to get around this? How do I fix this?
- "Waiting" executions
For my React Native App, I have had no issues deploying a function in Appwrite & the executions either working or failing. Now I am getting status code - 0 & j...