Skip to content

Commit 9180b6b

Browse files
committed
fix-exchange-request-headers
1 parent 993abe0 commit 9180b6b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/components/TestIframe.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@ function TestIframe() {
148148
sessionStorage.removeItem('silent-auth-verifier');
149149
const projectId = 'Puse136yK1TiyR4tmmaVToRDQs9icEIl';
150150
const customDomain = 'https://auth.reuven.descope.org';
151-
const redirectUri = `${window.location.origin}/silent-callback`;
152151
const res = await fetch(`${customDomain}/v1/auth/oauth/exchange`, {
153152
method: 'POST',
154-
headers: { 'Content-Type': 'application/json' },
155-
body: JSON.stringify({ code: event.data.code, codeVerifier: verifier, clientId: projectId, redirectUri }),
153+
headers: {
154+
'Content-Type': 'application/json',
155+
'Authorization': `Bearer ${projectId}`,
156+
},
157+
body: JSON.stringify({ code: event.data.code, codeVerifier: verifier }),
156158
credentials: 'include',
157159
});
158160
if (res.ok) {

0 commit comments

Comments
 (0)