From 3ee3b37dac8d68223576618692bf3d29e03c44ea Mon Sep 17 00:00:00 2001 From: gearnode Date: Tue, 25 Feb 2025 23:24:52 +0100 Subject: [PATCH] Add missing fullname for signup Signed-off-by: gearnode --- apps/console/src/pages/RegisterPage.tsx | 19 ++++++++++++++++--- pkg/api/console/v1/auth_handlers.go | 12 ++++++++++++ pkg/usrmgr/usrmgr.go | 6 ++++-- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/apps/console/src/pages/RegisterPage.tsx b/apps/console/src/pages/RegisterPage.tsx index 2dbc2f677..b89e4bfe0 100644 --- a/apps/console/src/pages/RegisterPage.tsx +++ b/apps/console/src/pages/RegisterPage.tsx @@ -11,6 +11,7 @@ import { useAuth } from "@/contexts/AuthContext"; export default function RegisterPage() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [fullName, setFullName] = useState(""); const [isLoading, setIsLoading] = useState(false); const { toast } = useToast(); const navigate = useNavigate(); @@ -19,10 +20,10 @@ export default function RegisterPage() { const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); - if (!email || !password) { + if (!email || !password || !fullName) { toast({ title: "Error", - description: "Email and password are required", + description: "Full name, email, and password are required", variant: "destructive", }); return; @@ -37,7 +38,7 @@ export default function RegisterPage() { "Content-Type": "application/json", }, credentials: "include", - body: JSON.stringify({ email, password }), + body: JSON.stringify({ email, password, fullName }), }); if (!response.ok) { @@ -82,6 +83,18 @@ export default function RegisterPage() {
+
+ + setFullName(e.target.value)} + required + /> +
+