/home/techb158/cosmic-risk.abdallabala.com/src/app/signup
NameSizeModeActions
page.jsx34240644editdlrm
Edit: /home/techb158/cosmic-risk.abdallabala.com/src/app/signup/page.jsx (3424B)
"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; export default function SignupPage() { const router = useRouter(); const [email, setEmail] = useState(""); const [displayName, setDisplayName] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(false); async function handleSubmit(event) { event.preventDefault(); setError(""); setLoading(true); try { const res = await fetch("/api/auth/signup", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email, displayName, password }) }); if (!res.ok) { const data = await res.json(); throw new Error(data.error || "Signup failed"); } router.push("/dashboard"); } catch (err) { setError(err.message); setLoading(false); } } return (
COSMIC AI-Risk SaaS

Create account

Sign up for a new workspace

{error &&
{error}
}
setEmail(e.target.value)} required style={{ width: "100%", padding: "10px 12px", borderRadius: 8, border: "1px solid var(--line)", fontSize: 16, boxSizing: "border-box" }} />
setDisplayName(e.target.value)} style={{ width: "100%", padding: "10px 12px", borderRadius: 8, border: "1px solid var(--line)", fontSize: 16, boxSizing: "border-box" }} />
setPassword(e.target.value)} required minLength={8} style={{ width: "100%", padding: "10px 12px", borderRadius: 8, border: "1px solid var(--line)", fontSize: 16, boxSizing: "border-box" }} />

Already have an account?

); }