(docs): explain why PAR needs a credentials-omitted client

This commit is contained in:
Chirag Aggarwal committed 2026-07-08 15:22:11 +05:30
1 parent 32ee3fc9d8
commit f3e76aa628
1 file changed
+5 -2
@@ -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)