| 18 | const GITHUB_CALLBACK_BASE_URL = |
| 19 | process.env.NODE_ENV === 'production' ? 'https://app.kilocode.ai' : APP_URL; |
| 20 | |
| 21 | function errorPage(title: string, message: string, status: number): Response { |
| 22 | return new Response( |
| 23 | `<!DOCTYPE html> |
| 24 | <html><head><meta charset="utf-8"><title>${title}</title></head> |
| 25 | <body style="font-family:system-ui,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0"> |
| 26 | <div style="text-align:center"> |
| 27 | <h1>${title}</h1> |
| 28 | <p>${message}</p> |
| 29 | </div> |
| 30 | </body></html>`, |
| 31 | { status, headers: { 'content-type': 'text/html; charset=utf-8' } } |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | export async function GET(request: NextRequest) { |