-
-
Save ireneyiu/d2f7db90f96312236309 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wfApp.settings.Password.prototype.validate = function() { | |
if (!this.old.length) { | |
return {valid: false, errors: "Please enter your current password."}; | |
} else if (this.newPass.length < 6) { | |
return {valid: false, errors: "New password must be at least 6 characters."}; | |
} else if (this.newPass !== this.verify) { | |
return {valid: false, errors: "New password and confirmation do not match."}; | |
} else if (this.newPass === this.old) { | |
return {valid: false, errors: "New password should be different from current password."}; | |
} else { | |
return {valid: true}; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment