From 00407a4276e3309c2ac6e2b68d2a7ed7fc3c2ed3 Mon Sep 17 00:00:00 2001 From: edwin6666 Date: Tue, 10 Oct 2023 09:59:10 -0400 Subject: [PATCH] Fix password length validation now it does not allow creating a password shorter than 6 characters --- src/hooks/useSignupLogic.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hooks/useSignupLogic.js b/src/hooks/useSignupLogic.js index 5106eb2..aaeb1f8 100644 --- a/src/hooks/useSignupLogic.js +++ b/src/hooks/useSignupLogic.js @@ -26,6 +26,12 @@ const useSignupLogic = () => { const handleSubmit = async (e) => { e.preventDefault(); try { + + if (data.password.length < 6) { + toast.error("Password must be at least 6 characters long."); + return; + } + const url = SignupUrl; const { data: res } = await axios.post(url, data); const roles = res?.roles;