Correct validation message for short passwords

closes #833
This commit is contained in:
Hannah Wolfe 2013-09-19 08:41:04 +01:00
parent 5528423636
commit 32d1076d35
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@
Ghost.Validate._errors = []; Ghost.Validate._errors = [];
Ghost.Validate.check(email).isEmail(); Ghost.Validate.check(email).isEmail();
Ghost.Validate.check(password, "Password too short").len(5); Ghost.Validate.check(password, "Please enter a password").len(0);
if (Ghost.Validate._errors.length > 0) { if (Ghost.Validate._errors.length > 0) {
Ghost.Validate.handleErrors(); Ghost.Validate.handleErrors();
@ -79,7 +79,7 @@
Ghost.Validate._errors = []; Ghost.Validate._errors = [];
Ghost.Validate.check(name, "Please enter a name").len(1); Ghost.Validate.check(name, "Please enter a name").len(1);
Ghost.Validate.check(email, "Please enter a correct email address").isEmail(); Ghost.Validate.check(email, "Please enter a correct email address").isEmail();
Ghost.Validate.check(password, "Please enter a password").len(5); Ghost.Validate.check(password, "Your password is not long enough. It must be at least 8 characters long.").len(8);
if (Ghost.Validate._errors.length > 0) { if (Ghost.Validate._errors.length > 0) {
Ghost.Validate.handleErrors(); Ghost.Validate.handleErrors();

View File

@ -14,7 +14,7 @@ var User,
function validatePasswordLength(password) { function validatePasswordLength(password) {
try { try {
GhostBookshelf.validator.check(password, "Your password is not long enough. It must be at least 8 chars long.").len(8); GhostBookshelf.validator.check(password, "Your password is not long enough. It must be at least 8 characters long.").len(8);
} catch (error) { } catch (error) {
return when.reject(error); return when.reject(error);
} }