export const runtime = 'edge'; import Link from 'next/link'; const API_BASE = process.env.NEXT_PUBLIC_API_BASE ?? 'https://cypher.arcrun.dev'; export default function LoginPage({ searchParams, }: { searchParams: Promise<{ error?: string; redirect?: string }>; }) { return ( ); } async function LoginContent({ searchParamsPromise, }: { searchParamsPromise: Promise<{ error?: string; redirect?: string }>; }) { const params = await searchParamsPromise; const error = params.error; const redirect = params.redirect ?? '/dashboard'; const googleUrl = `${API_BASE}/auth/google/start?redirect=${encodeURIComponent(redirect)}`; const githubUrl = `${API_BASE}/auth/github/start?redirect=${encodeURIComponent(redirect)}`; const errorMessages: Record = { cancelled: '登入已取消。', invalid_state: '安全性驗證失敗,請重試。', server_error: '伺服器錯誤,請稍後重試。', github_email_required: 'GitHub 帳號需要設定公開 Email 才能登入。', }; return (
{/* Logo */}
arcrun
{/* Card */}

登入或建立帳號

取得您的 API Key,立即開始使用

{error && (
{errorMessages[error] ?? '登入時發生錯誤,請重試。'}
)}
{/* Google */} Continue with Google {/* GitHub */} Continue with GitHub

登入即表示您同意我們的服務條款。 不需要信用卡。

← 返回首頁
); } function GoogleIcon() { return ( ); } function GitHubIcon() { return ( ); }