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
- One to many 2 way, console UI not correc...
Hey, seems I'm facing the exactly same issue with this one: https://github.com/appwrite/appwrite/issues/6016 Since this Github issue stay open for so long, let ...
- Server Down
Appwrite services are down. When will they start working again?
- My cloud functions failing 3 days ago (P...
Hi, My cloud function using python has been failing for 3 days, I didn't push any new deployments... Its something to do with it not recognising the entrypoi...