Add missing fullname for signup
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -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() {
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="fullName">Full Name</Label>
|
||||
<Input
|
||||
id="fullName"
|
||||
type="text"
|
||||
placeholder="John Doe"
|
||||
value={fullName}
|
||||
onChange={(e) => setFullName(e.target.value)}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="email">Email</Label>
|
||||
<Input
|
||||
|
||||
Reference in New Issue
Block a user