- Renamed validatePassword method, usePwstrength and useZxcvbn,

- Moved passwordOptions from settings.json to ActiveEntry configuration object
- Used zxcvbn rule set if showPasswordStrengthIndicator is true, used regular expression rule set if showPasswordStrengthIndicator is false
This commit is contained in:
Aysel Afsar committed 2016-02-04 17:53:01 -05:00
1 parent 4e986c8395
commit e659f0f4b3
17 files changed
+165 -102

No files matched your search

+9 -2
View File
@@ -22,6 +22,10 @@ if (Meteor.isClient) {
},
themeColors: {
primary: ""
},
passwordOptions: {
requireStrongPasswords: false,
showPasswordStrengthIndicator: false
}
});
}
@@ -33,6 +37,9 @@ if (Meteor.isClient) {
// Success messages
ActiveEntry.successMessages = new ReactiveDict('successMessages');
// Change password warning message according to whether zxcvbn is turned on
Session.set('passwordWarning', 'Password must have at least 8 characters. It must contain at least 1 uppercase, 1 lowercase, 1 number and 1 special character.');
}
ActiveEntry.configure = function (configObject) {
@@ -45,8 +52,8 @@ ActiveEntry.verifyPassword = function (password) {
if (password.length === 0) {
ActiveEntry.errorMessages.set('password', 'Password is required');
ActiveEntry.successMessages.set('password', null);
} else if (!validatePassword(password)) {
ActiveEntry.errorMessages.set('password', 'Password must have at least 8 characters. It must contain at least 1 uppercase, 1 lowercase, 1 number and 1 special character.');
} else if (!checkPasswordStrength(password)) {
ActiveEntry.errorMessages.set('password', Session.get('passwordWarning'));
ActiveEntry.successMessages.set('password', null);
} else {
//ActiveEntry.errorMessages.set('password', 'Password present');