MCPcopy
hub / github.com/codeaashu/claude-code / waitForAuthorizationCode

Method waitForAuthorizationCode

src/services/oauth/index.ts:134–154  ·  view source on GitHub ↗
(
    state: string,
    onReady: () => Promise<void>,
  )

Source from the content-addressed store, hash-verified

132 }
133
134 private async waitForAuthorizationCode(
135 state: string,
136 onReady: () => Promise<void>,
137 ): Promise<string> {
138 return new Promise((resolve, reject) => {
139 // Set up manual auth code resolver
140 this.manualAuthCodeResolver = resolve
141
142 // Start automatic flow
143 this.authCodeListener
144 ?.waitForAuthorization(state, onReady)
145 .then(authorizationCode => {
146 this.manualAuthCodeResolver = null
147 resolve(authorizationCode)
148 })
149 .catch(error => {
150 this.manualAuthCodeResolver = null
151 reject(error)
152 })
153 })
154 }
155
156 // Handle manual flow callback when user pastes the auth code
157 handleManualAuthCodeInput(params: {

Callers 1

startOAuthFlowMethod · 0.95

Calls 2

waitForAuthorizationMethod · 0.80
resolveFunction · 0.50

Tested by

no test coverage detected