Add a new password rule

Password cannot contain username
This commit is contained in:
Justin Edmund 2022-02-01 00:43:10 -08:00
parent f1b50fe051
commit de96600122

View file

@ -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'