perf: validate JWT locally instead of calling Supabase API

- Use jose library for ES256 JWT verification with cached JWKS
- Fallback to Supabase only if JWT verification fails
- Use findUnique instead of findFirst for DB lookup
- Estimated improvement: ~450ms -> ~5ms per request
This commit is contained in:
Jose Selesan
2026-04-13 17:50:52 -03:00
parent 1d09716492
commit b7c303377a
3 changed files with 44 additions and 11 deletions

View File

@@ -6,6 +6,7 @@
"packages/*"
],
"dependencies": {
"jose": "^6.2.2",
"zod": "^4.3.6"
},
"scripts": {