// app/login/page.tsx "use client"; import { FormEvent, useState } from "react"; import { useRouter, useSearchParams } from "next/navigation"; import Link from "next/link"; import { useAuth } from "@/context/AuthContext"; export default function LoginPage() { const router = useRouter(); const searchParams = useSearchParams(); const { login, loading } = useAuth(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(null); const next = searchParams.get("next") || "/builder"; async function handleSubmit(e: FormEvent) { e.preventDefault(); setError(null); try { await login({ email, password }); router.push(next); } catch (err: any) { setError(err.message ?? "Failed to log in"); } } return (

Log In to The Armory

Use your beta credentials to get back to your saved builds.

{error && (
{error}
)}
setEmail(e.target.value)} />
setPassword(e.target.value)} />

New here?{" "} Join the beta .

); }