abstracted out the validation js, need to add it to signup, then basically write up broken auth for both lack of pwd complexity and username/password enumeration

This commit is contained in:
Ken Johnson
2013-05-22 11:47:00 -04:00
parent 46c1af43cd
commit e03fd8548c
3 changed files with 38 additions and 78 deletions
+35
View File
@@ -0,0 +1,35 @@
function validation(){
$("#account_edit").validate({
rules: {
"user[password]": {
required: false,
minlength: 5
},
"user[password_confirmation]": {
required: false,
minlength: 5,
equalTo: "#user_password"
}
},
messages: {
"user[password]": {
minlength: "Your password must be at least 6 characters long"
},
"user[password_confirmation]": {
minlength: "Your password must be at least 6 characters long",
equalTo: "Please enter the same password as above"
}
},
highlight: function(label) {
$("#submit_button").attr('disabled','disabled');
$(label).closest('.control-group').addClass('error');
},
success: function(label) {
label.closest('.control-group').addClass('success');
$("#submit_button").removeAttr('disabled');
}
});
};
$(document).ready(validation());