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

Function callbackPageHtml

cli/src/utils/chatgpt-oauth.ts:123–137  ·  view source on GitHub ↗
(success: boolean, errorMessage?: string)

Source from the content-addressed store, hash-verified

121}
122
123function callbackPageHtml(success: boolean, errorMessage?: string): string {
124 const title = success ? 'Connected — Codebuff' : 'Connection Failed — Codebuff'
125 const heading = success ? '✓ Connected to ChatGPT' : 'Connection Failed'
126 const headingColor = success ? '#4ade80' : '#f87171'
127 const body = success
128 ? 'You can close this tab and return to Codebuff.'
129 : `${escapeHtml(errorMessage ?? 'Unknown error')}. Return to Codebuff and try /connect:chatgpt again.`
130 return `<!DOCTYPE html>
131<html><head><meta charset="utf-8"><title>${title}</title></head>
132<body style="font-family:system-ui,sans-serif;display:flex;justify-content:center;align-items:center;min-height:100vh;margin:0;background:#0a0a0a;color:#e5e5e5">
133<div style="text-align:center;padding:2rem">
134<h1 style="color:${headingColor};margin-bottom:0.5rem">${heading}</h1>
135<p style="color:#a3a3a3">${body}</p>
136</div></body></html>`
137}
138
139function startCallbackServer(codeVerifier: string): Promise<ChatGptOAuthCredentials> {
140 const redirectUrl = new URL(CHATGPT_OAUTH_REDIRECT_URI)

Callers 1

startCallbackServerFunction · 0.85

Calls 1

escapeHtmlFunction · 0.85

Tested by

no test coverage detected