
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
- phantom relationships appear on parent c...
i have this bug were my past deleted collection apears as relationship to my parent collection. when i try to delete that relationship from parent it gives me e...
- Attributes Problem - Cloud
I am not able to see the attribute columns and their context on cloud. Can you help?
- Authorization header not working in Appw...
I have an Appwrite function that takes a custom bearer token as authentication. The function works fine locally when I test it with `appwrite run functions`, bu...
