mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
removed password length code, moved to separate PR
This commit is contained in:
parent
49fe86ae3c
commit
652871f0bd
1 changed files with 1 additions and 3 deletions
|
@ -50,9 +50,7 @@ module.exports.validateUsernameRemotely = username => (
|
||||||
module.exports.validatePassword = (password, username) => {
|
module.exports.validatePassword = (password, username) => {
|
||||||
if (!password) {
|
if (!password) {
|
||||||
return {valid: false, errMsgId: 'general.required'};
|
return {valid: false, errMsgId: 'general.required'};
|
||||||
// get length of password, considering unicode symbols as single chars.
|
} else if (password.length < 6) {
|
||||||
// see discussion at https://stackoverflow.com/a/54370584/2308190
|
|
||||||
} else if (Array.from(password).length < 6) {
|
|
||||||
return {valid: false, errMsgId: 'registration.validationPasswordLength'};
|
return {valid: false, errMsgId: 'registration.validationPasswordLength'};
|
||||||
} else if (password === 'password') {
|
} else if (password === 'password') {
|
||||||
return {valid: false, errMsgId: 'registration.validationPasswordNotEquals'};
|
return {valid: false, errMsgId: 'registration.validationPasswordNotEquals'};
|
||||||
|
|
Loading…
Reference in a new issue