import { useState, type FormEvent } from "react"; import { Link, Navigate } from "react-router-dom"; import { useAuth } from "../state/AuthContext"; export default function Login() { const { login, user, loading } = useAuth(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [busy, setBusy] = useState(false); if (!loading && user) return ; async function onSubmit(e: FormEvent) { e.preventDefault(); setError(""); setBusy(true); try { await login(email, password); } catch (err) { setError(err instanceof Error ? err.message : "Login failed"); } finally { setBusy(false); } } return (

Soulless Necromancer

Return to the wake

Sign in to reclaim your army.

{error &&

{error}

}

No vessel yet? Register

); }