YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix: check subscription for Clerk JWT auth path
Louis Beaumont136c076b81a3
diff --git a/packages/ai-gateway/src/utils/auth.ts b/packages/ai-gateway/src/utils/auth.tsindex d8724bca3..8cb2dfb18 100644--- a/packages/ai-gateway/src/utils/auth.ts+++ b/packages/ai-gateway/src/utils/auth.ts@@ -107,13 +107,15 @@ export async function validateAuth(request: Request, env: Env): Promise<AuthResu};}- // Check if it's a valid Clerk token (logged in but no subscription)+ // Check if it's a valid Clerk JWT tokenconst clerkResult = await verifyClerkToken(env, token);if (clerkResult.valid) {const resolvedUserId = clerkResult.userId || token;+ // Check subscription using the resolved Clerk user ID+ const { isValid: hasSubscription } = await validateSubscriptionWithId(env, resolvedUserId);return {isValid: true,- tier: 'logged_in',+ tier: hasSubscription ? 'subscribed' : 'logged_in',deviceId: resolvedUserId,userId: resolvedUserId,};