From f3e76aa628d055480e3187f85ce9ee256ea34940 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 8 Jul 2026 15:22:11 +0530 Subject: [PATCH] (docs): explain why PAR needs a credentials-omitted client --- src/routes/(public)/oauth2/consent/+page.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/(public)/oauth2/consent/+page.svelte b/src/routes/(public)/oauth2/consent/+page.svelte index f12d12cfd..68c8549bb 100644 --- a/src/routes/(public)/oauth2/consent/+page.svelte +++ b/src/routes/(public)/oauth2/consent/+page.svelte @@ -33,8 +33,11 @@ phase = outcome === 'approved' ? 'approved' : 'denied'; } - // /par is served like /token: wildcard CORS with credentials disabled, so - // the browser rejects the default client's credentialed fetch. + // /par is public (no auth needed), which is exactly why the default client + // can't call it: public endpoints are served like /token — wildcard CORS + // with Access-Control-Allow-Credentials: false — and the browser blocks + // sdk.forConsole's credentialed (cookie-sending) fetch against that. This + // client sends the same request with credentials omitted. function anonymousOAuth2(): Oauth2 { const client = new Client() .setEndpoint(sdk.forConsole.client.config.endpoint)