Validating supabase JWT token locally (without making a request to their API) [solved]
I have a nextjs api handler that calls this to validate the user (and then makes a DB request using user.id):
The issue is it takes about 600ms for that to run, since it makes a request to supabase. Is there a way to validate the cookie locally?
1 Reply
If supabase is using a JWT on the cookie then you can verify the JWT is valid locally. There are libs that exist which can do that for you.