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:
@@ -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());
|
||||
Reference in New Issue
Block a user