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
- How can I get the Google Avatar of the u...
How can I get the Google Avatar of the user that signed in with Google?
- Function Go module undefined
Attached image, why module is undefine, also when I'm running `appwrite run function`, it still undefine, why?
- Unable to deploy site
I am on a new project where i want to deploy a new site, but what ever i'am trying - i get this error, and thats if i manually deploy with gz file 5.4kb or thro...