Friday, 28 November 2014

password to be more secure , that includes minimum one capital latter ,one numeric character , minimum 8 characters in magento



For that i have change in Validation.js of magento

please find this code


['validate-password', 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.', function(v) {
                var pass=v.strip(); /*strip leading and trailing spaces*/
                return !(pass.length>0 && pass.length < 6);
            }],

and replace it with below code


['validate-password', 'Please enter 8 or more characters.Password should contain one numeric character, one capital letter

. Leading or trailing spaces will be ignored.', function(v) {
                var pass=v.strip(); /*strip leading and trailing spaces*/
if (!(/[a-z]/i.test(v)) || !(/[0-9]/.test(v)) || !(/[A-Z]/.test(v))) {
                    return false;
                }

                return !(pass.length>0 && pass.length < 8);
            }],

No comments:

Post a Comment