Skip to content

Commit 30835cd

Browse files
committed
fix: Clerk JWT verification and Inngest dev config
- Fix VerifyTokenOptions passing empty string instead of None for jwt_key, which caused the Clerk SDK to skip JWKS remote fetch and fail with "Failed to resolve JWK" on every authenticated request (401) - Remove INNGEST_DEV=1 from docker-compose.dev.yml so local dev uses production Inngest credentials from .env
1 parent d325b2b commit 30835cd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

backend/utils/auth_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ async def _verify_clerk_jwt(token: str) -> dict:
5050
if config.CLERK_SECRET_KEY or config.CLERK_JWT_KEY:
5151
# Keys configured — verify signature, fail-closed
5252
options = VerifyTokenOptions(
53-
secret_key=config.CLERK_SECRET_KEY or "",
54-
jwt_key=config.CLERK_JWT_KEY or "",
53+
secret_key=config.CLERK_SECRET_KEY,
54+
jwt_key=config.CLERK_JWT_KEY,
5555
)
5656
return await asyncio.to_thread(verify_token, token, options)
5757
# No keys — dev convenience mode
@@ -61,8 +61,8 @@ async def _verify_clerk_jwt(token: str) -> dict:
6161
# PRODUCTION mode: enforce signature verification
6262
if config.CLERK_SECRET_KEY or config.CLERK_JWT_KEY:
6363
options = VerifyTokenOptions(
64-
secret_key=config.CLERK_SECRET_KEY or "",
65-
jwt_key=config.CLERK_JWT_KEY or "",
64+
secret_key=config.CLERK_SECRET_KEY,
65+
jwt_key=config.CLERK_JWT_KEY,
6666
)
6767
# verify_token() does synchronous HTTP I/O (JWKS fetch) when jwt_key is absent,
6868
# so run in a thread to avoid blocking the async event loop.

docker-compose.dev.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ services:
1515
- ENV_MODE=local
1616
- REDIS_URL=redis://redis:6379
1717
- PYTHONUNBUFFERED=1
18-
- INNGEST_DEV=1
1918
depends_on:
2019
redis:
2120
condition: service_healthy

0 commit comments

Comments
 (0)