-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimum password length + Static Pages fixes #11474
Conversation
return this.password.length >= MINIMUM_PASSWORD_LENGTH; | ||
}, | ||
passwordInvalid () { | ||
if (this.password.length <= 0) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this <=0 line correct? Doesn't it mean that passwordInvalid
will be false
(i.e., password will be considered valid) if the length is 0 or less?
Are this line and also line 864 needed at all? I think the checks against MINIMUM_PASSWORD_LENGTH will handle all the cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this <=0 line correct? Doesn't it mean that passwordInvalid will be false (i.e., password will be considered valid) if the length is 0 or less?
The idea here is (taken from other fields) not to show the error class until the user has typed something int to field
passwordInvalid () { | ||
if (this.password.length <= 0) return false; | ||
return this.password.length < MINIMUM_PASSWORD_LENGTH; | ||
}, | ||
passwordConfirmValid () { | ||
if (this.passwordConfirm.length <= 3) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be changed to 8 or the whole line deleted? I don't think a length check is needed here because the only important check is that the password confirm value is the same as the password value (and we're already checking length for the password).
Same for passwordConfirmInvalid below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <= 3 was a previous check that I think was supposed not to show the error until the user has typed at least 3 characters, which I feel like makes sense from an UX perspective but I'm not 100% sure
Enforce a minimum password length of 8 characters.