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
- Cant configure email templates
i configure it on the console, and when i send the OTP, it sends with appwrite's email (instead of custom smtp) and with the branding, but i have the Pro (educa...
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...