Skip to content

fix: remove Auth0Server dependency from getClaims and requireClaims - #10

Merged
yogeshchoudhary147 merged 3 commits into
mainfrom
fix/api-only-config
Aug 21, 2026
Merged

fix: remove Auth0Server dependency from getClaims and requireClaims#10
yogeshchoudhary147 merged 3 commits into
mainfrom
fix/api-only-config

Conversation

@yogeshchoudhary147

Copy link
Copy Markdown
Contributor

Summary

  • getClaims and requireClaims no longer require a full Auth0Server config
  • verifyJwt now reads AUTH0_DOMAIN and AUTH0_AUDIENCE directly from env vars instead of calling getInstance(), which triggered the full session config validation
  • API-only deployments now only need two env vars instead of five

Before this fix, a developer using only requireClaims was forced to set AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, AUTH0_SESSION_SECRET, and AUTH0_APP_BASE_URL — none of which are used during JWT verification.

Test plan

  • requireClaims / getClaims work with only AUTH0_DOMAIN + AUTH0_AUDIENCE set
  • ConfigurationError thrown when AUTH0_DOMAIN is missing
  • ConfigurationError thrown when AUTH0_AUDIENCE is missing
  • Full SSR session flow unaffected
  • npx vitest run — all 320 tests pass

Comment thread src/server/api.ts

Copy link
Copy Markdown

src/server/api.ts:67 — small doc nit: the @throws on getClaims still says "if AUTH0_AUDIENCE is not configured", but verifyJwt now also throws ConfigurationError when AUTH0_DOMAIN is missing. Worth updating that line to mention both. (Couldn't leave this inline — the line isn't part of the diff.)

@yogeshchoudhary147
yogeshchoudhary147 merged commit 38cf7ce into main Aug 21, 2026
4 checks passed
@yogeshchoudhary147
yogeshchoudhary147 deleted the fix/api-only-config branch August 21, 2026 03:28
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.

2 participants