From de966001222b10b1319c9d4310d9752554fb37d8 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 1 Feb 2022 00:43:10 -0800 Subject: [PATCH] Add a new password rule Password cannot contain username --- components/SignupModal/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/SignupModal/index.tsx b/components/SignupModal/index.tsx index a8846752..75179fa5 100644 --- a/components/SignupModal/index.tsx +++ b/components/SignupModal/index.tsx @@ -124,6 +124,12 @@ const SignupModal = (props: Props) => { : 'That email address is not valid' break + case 'password': + newErrors.password = passwordInput.current?.value.includes(usernameInput.current?.value!) + ? 'Your password should not contain your username' + : '' + break + case 'password': newErrors.password = value.length < 8 ? 'Password must be at least 8 characters'