Skip to content

feat: accept errors.detailed on every direct-answering middleware - #158

Open
mandarini wants to merge 1 commit into
mainfrom
fix/oauth-misconfig-json-error
Open

feat: accept errors.detailed on every direct-answering middleware#158
mandarini wants to merge 1 commit into
mainfrom
fix/oauth-misconfig-json-error

Conversation

@mandarini

@mandarini mandarini commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes SDK-1811: when withOAuthProtectedResource cannot derive resourceServer or authorizationServer, it answers with the library's JSON error envelope (500 plus x-supabase-server-error) instead of letting the EnvError escape as the runtime's plain-text 500. The URL derivations carry the same construction mark withSupabase uses, so a throw from a caller-supplied URL function still propagates. Every middleware that answers directly (withClaims, withRequiredClaims, withPostgresClient, withPostgresAdminClient, withOAuthProtectedResource) also accepts errors: { detailed: false } and trims its short-circuit body to code and message, the same as withSupabase. Each short-circuit has a test for both body shapes, and the docs describe the new responses.

@mandarini
mandarini requested review from a team as code owners September 11, 2026 16:09
@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: ffe1bfb

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