From 33d2b5dd54dab5878902862c4c45d9ea30609969 Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Fri, 2 Dec 2022 21:18:53 +0800 Subject: [PATCH] fix: password length > 6 --- src/routes/onboarding/steps/adminAccount.tsx | 3 +++ src/routes/reg/Register.tsx | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/routes/onboarding/steps/adminAccount.tsx b/src/routes/onboarding/steps/adminAccount.tsx index 01a1236d..74d6f5e5 100644 --- a/src/routes/onboarding/steps/adminAccount.tsx +++ b/src/routes/onboarding/steps/adminAccount.tsx @@ -157,6 +157,9 @@ const AdminAccount: FC = ({ serverName, nextStep }) => { } else if (password === "") { toast.error("Please enter admin password!"); return; + } else if (password.length < 6) { + toast.error("Password length greater than 6!"); + return; } else if (password !== confirm) { toast.error("Two passwords do not match!"); return; diff --git a/src/routes/reg/Register.tsx b/src/routes/reg/Register.tsx index 2c7d1d31..fbfe719c 100644 --- a/src/routes/reg/Register.tsx +++ b/src/routes/reg/Register.tsx @@ -55,6 +55,10 @@ export default function Reg() { const handleReg = async (evt: FormEvent) => { evt.preventDefault(); const { email, password, confirmPassword } = input; + if (password.length < 6) { + toast.error("Password greater than 6!"); + return; + } if (password !== confirmPassword) { toast.error("Not Same Password!"); return;