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

Function registerOauthCallbackRelay

src/services/oauth/client.ts:198–222  ·  view source on GitHub ↗
(params: {
  relayId: string
  state: string
  timeoutMs?: number
})

Source from the content-addressed store, hash-verified

196}
197
198export async function registerOauthCallbackRelay(params: {
199 relayId: string
200 state: string
201 timeoutMs?: number
202}): Promise<void> {
203 try {
204 await withTransientRetry(() =>
205 axios.post(
206 getOauthCallbackRelayEndpoint('/oauth/callback-relay/register'),
207 {
208 relay_id: params.relayId,
209 state: params.state,
210 },
211 {
212 headers: { 'Content-Type': 'application/json' },
213 timeout: params.timeoutMs ?? 1000,
214 },
215 ),
216 )
217 } catch (error) {
218 throw new Error(
219 `OAuth callback relay registration failed: ${error instanceof Error ? error.message : String(error)}`,
220 )
221 }
222}
223
224export async function pollOauthCallbackRelay(
225 relayId: string,

Callers 1

client.test.tsFile · 0.85

Calls 2

withTransientRetryFunction · 0.85

Tested by

no test coverage detected