(
state: string,
onReady: () => Promise<void>,
)
| 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: { |
no test coverage detected