This commit is contained in:
Tiago Ribeiro
2024-09-02 16:09:44 +01:00
parent 90cb705ad2
commit b0ab8a8fce

View File

@@ -100,7 +100,7 @@ export default function UserCreator({user, users, permissions, onFinish}: Props)
if (!name || name.trim().length === 0) return toast.error("Please enter a valid name!"); if (!name || name.trim().length === 0) return toast.error("Please enter a valid name!");
if (!email || email.trim().length === 0) return toast.error("Please enter a valid e-mail address!"); if (!email || email.trim().length === 0) return toast.error("Please enter a valid e-mail address!");
if (users.map((x) => x.email).includes(email.trim())) return toast.error("That e-mail is already in use!"); if (users.map((x) => x.email).includes(email.trim())) return toast.error("That e-mail is already in use!");
if (!password || password.trim().length === 0) return toast.error("Please enter a valid password!"); if (!password || password.trim().length < 6) return toast.error("Please enter a valid password!");
if (password !== confirmPassword) return toast.error("The passwords do not match!"); if (password !== confirmPassword) return toast.error("The passwords do not match!");
setIsLoading(true); setIsLoading(true);