removed password length code, moved to separate PR

This commit is contained in:
Ben Wheeler 2019-10-30 14:32:04 -04:00
parent 49fe86ae3c
commit 652871f0bd

View file

@ -50,9 +50,7 @@ module.exports.validateUsernameRemotely = username => (
module.exports.validatePassword = (password, username) => {
if (!password) {
return {valid: false, errMsgId: 'general.required'};
// get length of password, considering unicode symbols as single chars.
// see discussion at https://stackoverflow.com/a/54370584/2308190
} else if (Array.from(password).length < 6) {
} else if (password.length < 6) {
return {valid: false, errMsgId: 'registration.validationPasswordLength'};
} else if (password === 'password') {
return {valid: false, errMsgId: 'registration.validationPasswordNotEquals'};