MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / handleChatGptAuthCode

Function handleChatGptAuthCode

cli/src/components/chatgpt-connect-banner.tsx:192–213  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

190}
191
192export async function handleChatGptAuthCode(code: string): Promise<{
193 success: boolean
194 message: string
195}> {
196 try {
197 await exchangeChatGptCodeForTokens(code)
198 stopChatGptOAuthServer()
199 return {
200 success: true,
201 message:
202 'Successfully connected your ChatGPT subscription! Codebuff will use it for supported OpenAI streaming requests.',
203 }
204 } catch (err) {
205 return {
206 success: false,
207 message:
208 err instanceof Error
209 ? err.message
210 : 'Failed to exchange ChatGPT authorization code',
211 }
212 }
213}

Callers 1

routeUserPromptFunction · 0.90

Calls 2

stopChatGptOAuthServerFunction · 0.90

Tested by

no test coverage detected