Added a wait for the token exchange

This commit is contained in:
Glen Maddern 2025-03-31 22:28:10 +11:00
parent 9fbba0509c
commit d5f5b31786
4 changed files with 20 additions and 3 deletions

View file

@ -38,10 +38,13 @@ async function runProxy(serverUrl: string, callbackPort: number, clean: boolean
clientName: 'MCP CLI Proxy',
clean,
})
// If auth was completed by another instance, just log that we'll use the auth from disk
if (skipBrowserAuth) {
log('Authentication was completed by another instance - will use tokens from disk')
// TODO: remove, the callback is happening before the tokens are exchanged
// so we're slightly too early
await new Promise((res) => setTimeout(res, 1_000))
}
// Create the STDIO transport for local connections