Skip to content

fix: report missing JWKS as ENV_ERROR in user-mode verification - #128

Merged
mandarini merged 2 commits into
mainfrom
fix/missing-jwks-env-error
Aug 27, 2026
Merged

fix: report missing JWKS as ENV_ERROR in user-mode verification#128
mandarini merged 2 commits into
mainfrom
fix/missing-jwks-env-error

Conversation

@mandarini

@mandarini mandarini commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

withSupabase({ auth: 'user' }) returned a 401 INVALID_CREDENTIALS when a request carried a user token but no JWKS source was configured, while the standalone claims middlewares report the same state as a 500 ENV_ERROR. A missing JWKS is a server misconfiguration, not a caller error, so verifyCredentials now reports it as a 500 ENV_ERROR, checked only after every allowed mode has been tried. Fallthrough is unchanged: another matching mode still wins, and requests with no token or with an sb_* key in the Authorization slot still get a 401. Adds parity tests that pin withRequiredClaims and withSupabase({ auth: 'user' }) to the same status and code for the same request, and documents the new case in the error-handling table.

@mandarini mandarini self-assigned this Aug 26, 2026
@mandarini
mandarini force-pushed the fix/missing-jwks-env-error branch from ab1ea42 to ab44d43 Compare August 27, 2026 13:18
@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@supabase/server@128

commit: d005211

Base automatically changed from feat/required-claims-gate to main August 27, 2026 14:45
@mandarini
mandarini force-pushed the fix/missing-jwks-env-error branch from ab44d43 to fa38ee1 Compare August 27, 2026 14:45
@mandarini
mandarini marked this pull request as ready for review August 27, 2026 14:57
@mandarini
mandarini requested review from a team as code owners August 27, 2026 14:57
@mandarini
mandarini merged commit 9c064c5 into main Aug 27, 2026
9 checks passed
@mandarini
mandarini deleted the fix/missing-jwks-env-error branch August 27, 2026 15:05
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