move JWT validation to package

This commit is contained in:
Devin Zuczek
2026-07-09 20:14:23 -04:00
parent cb48cefa7d
commit bdebc50075
35 changed files with 102 additions and 530 deletions
+9
View File
@@ -0,0 +1,9 @@
# jwt
Shared HS256 JWT helpers for the recflare workers. Single source of truth for
token validation and generation, so the same signing/verification code isn't
re-copied per worker.
`auth` signs tokens (`generateToken`); every worker validates the incoming
Bearer token (`validateAndGetAccountId`). Both take the signing key from the
shared `JWT_SECRET` binding (see each worker's `context.ts`).