feat(auth): restore Google sign-in and AI admin test routes
Some checks failed
CI / Lint, Test & Build (push) Failing after 7m46s
CI / Deploy production (on server) (push) Has been cancelled

Google OAuth was implemented locally but never deployed; the login button
only renders when AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET are set. Also
restores /api/ai/test-* endpoints removed by mistake and wires Google
credentials into deploy workflows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Antigravity
2026-05-17 17:17:42 +00:00
parent 396c60dec3
commit 5b794d6449
17 changed files with 448 additions and 52 deletions

View File

@@ -6,6 +6,7 @@ import { register } from '@/app/actions/register';
import Link from 'next/link';
import { Mail, Lock, User, ArrowRight, Sparkles } from 'lucide-react';
import { useLanguage } from '@/lib/i18n';
import { GoogleSignInButton } from '@/components/google-sign-in-button';
function RegisterButton() {
const { pending } = useFormStatus();
@@ -28,7 +29,19 @@ function RegisterButton() {
);
}
export function RegisterForm() {
function AuthDivider({ label }: { label: string }) {
return (
<div className="relative flex items-center py-2">
<div className="flex-grow border-t border-[var(--border)]" />
<span className="mx-4 text-[10px] uppercase tracking-widest text-[var(--muted-foreground)] font-bold">
{label}
</span>
<div className="flex-grow border-t border-[var(--border)]" />
</div>
);
}
export function RegisterForm({ googleAuthEnabled = false }: { googleAuthEnabled?: boolean }) {
const [errorMessage, dispatch] = useActionState(register, undefined);
const { t } = useLanguage();
@@ -44,6 +57,13 @@ export function RegisterForm() {
</p>
</div>
{googleAuthEnabled && (
<>
<GoogleSignInButton label={t('auth.continueWithGoogle')} />
<AuthDivider label={t('auth.orContinueWith')} />
</>
)}
<form action={dispatch} className="space-y-4">
<div className="space-y-1.5">
<label className="text-[10px] uppercase tracking-widest font-bold text-[var(--muted-foreground)] px-4">