()
| 210 | } |
| 211 | |
| 212 | export function connectChatGptOAuth(): { |
| 213 | authUrl: string |
| 214 | credentials: Promise<ChatGptOAuthCredentials> |
| 215 | } { |
| 216 | stopChatGptOAuthServer() |
| 217 | |
| 218 | const { codeVerifier, authUrl } = startChatGptOAuthFlow() |
| 219 | const credentials = startCallbackServer(codeVerifier) |
| 220 | |
| 221 | void safeOpen(authUrl) |
| 222 | |
| 223 | return { authUrl, credentials } |
| 224 | } |
| 225 | |
| 226 | function parseAuthCodeInput(input: string): { code: string; state?: string } { |
| 227 | const trimmed = input.trim() |
no test coverage detected