MCPcopy Create free account
hub / github.com/Noumena-Network/code / completeAutomaticFlow

Function completeAutomaticFlow

src/services/oauth/oauthTestHarness.ts:369–380  ·  view source on GitHub ↗
(authorizeUrl)

Source from the content-addressed store, hash-verified

367 refreshGrantError = error
368 },
369 async completeAutomaticFlow(authorizeUrl) {
370 const authorizeResponse = await fetch(authorizeUrl, { redirect: 'manual' })
371 const callbackUrl = requireRedirectLocation(authorizeResponse, authorizeUrl)
372 const callbackResponse = await fetch(callbackUrl, { redirect: 'manual' })
373 const successLocation = callbackResponse.headers.get('location')
374 return {
375 code: new URL(callbackUrl).searchParams.get('code') ?? '',
376 state: new URL(callbackUrl).searchParams.get('state') ?? '',
377 callbackUrl,
378 successLocation,
379 }
380 },
381 async completeRelayFlow(authorizeUrl) {
382 const authorizeResponse = await fetch(authorizeUrl, { redirect: 'manual' })
383 const callbackUrl = requireRedirectLocation(authorizeResponse, authorizeUrl)

Callers

nothing calls this directly

Calls 3

fetchFunction · 0.85
requireRedirectLocationFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected