Skip to content

fix: hardcode Clerk issuer domain in auth.config.ts (fixes repeated auth failures) - #55

Merged
chintondutta merged 1 commit into
mainfrom
fix/hardcode-clerk-issuer-domain
Aug 11, 2026
Merged

fix: hardcode Clerk issuer domain in auth.config.ts (fixes repeated auth failures)#55
chintondutta merged 1 commit into
mainfrom
fix/hardcode-clerk-issuer-domain

Conversation

@chintondutta

Copy link
Copy Markdown
Contributor

Root cause of today's repeated "No auth provider found matching the given token" failures

`auth.config.ts` isn't a regular Convex function - it's evaluated by the Convex CLI at deploy time, in whatever environment is running `convex deploy`, not at runtime on Convex's own servers. That means Convex's dashboard-configured environment variables aren't in scope when this file is read, unlike e.g. `lib/secrets.ts`'s AWS credential reads, which run as real Convex actions and correctly see dashboard vars at call time.

We only ever set `CLERK_JWT_ISSUER_DOMAIN` in Convex's dashboard, never in Vercel's build environment. So every Vercel-triggered production deploy (`npx convex deploy --cmd 'pnpm build'`) was silently pushing an undefined domain to the auth provider config - explaining why this kept breaking after every fresh deploy today, regardless of how correct the Convex dashboard's value looked.

Fix

Hardcode the domain directly, since it's guaranteed correct regardless of which environment runs the deploy. Also added `CLERK_JWT_ISSUER_DOMAIN` to Vercel's env vars as a second layer of defense, but this hardcode is the actual guaranteed fix.

If this domain ever changes, it needs to be updated here directly (documented in the code comment).

Reading from process.env.CLERK_JWT_ISSUER_DOMAIN doesn't work reliably
here: this file is evaluated by the Convex CLI at deploy time (in
whatever environment is running `convex deploy`), not at runtime on
Convex's own servers like a regular function - so Convex's
dashboard-configured env vars aren't in scope here, unlike e.g.
lib/secrets.ts's AWS credential reads, which run as real Convex
actions and correctly see dashboard vars at call time.

We only ever set CLERK_JWT_ISSUER_DOMAIN in Convex's dashboard, never
in Vercel's build environment, so every Vercel-triggered deploy
(`npx convex deploy --cmd 'pnpm build'`) was silently pushing an
undefined domain - which explains the repeated "No auth provider
found matching the given token" failures today. Also added it to
Vercel's env vars as a second layer, but hardcoding here is the
guaranteed fix regardless of which environment runs the deploy.

If this domain ever changes, it needs to be updated here directly.
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solvia-web Ready Ready Preview Aug 11, 2026 7:24pm
solvia-widget Ready Ready Preview Aug 11, 2026 7:24pm

@chintondutta
chintondutta merged commit 4692894 into main Aug 11, 2026
4 checks passed
@chintondutta
chintondutta deleted the fix/hardcode-clerk-issuer-domain branch August 11, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant