LT-97: - Remove zxcvbn package because of version conflict,
- Add passwordOptions in ActiveEntry.configure - Toggle showPasswordStrengthIndicator to show password strength meter ui, toggle requireRegexValidation to set password regex for validation or requireStrongPasswords to create strong passwords by using zxcvbn. - Sign in/ sing up when enter key is pressed
This commit is contained in:
1 parent
5ec3cace94
commit
24e615da1e
15 files changed
+997
-733
No files matched your search
@@ -24,12 +24,15 @@ if (Meteor.isClient) {
|
||||
primary: ""
|
||||
},
|
||||
passwordOptions: {
|
||||
requireStrongPasswords: false,
|
||||
showPasswordStrengthIndicator: false
|
||||
showPasswordStrengthIndicator: true,
|
||||
requireRegexValidation: true
|
||||
//requireStrongPasswords: false
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// requireRegexValidation toggles regex
|
||||
// reqiureStrongPasswords toggles zxcvbn
|
||||
|
||||
if (Meteor.isClient) {
|
||||
ActiveEntry.errorMessages = new ReactiveDict('errorMessages');
|
||||
@@ -56,7 +59,6 @@ ActiveEntry.verifyPassword = function (password) {
|
||||
ActiveEntry.errorMessages.set('password', Session.get('passwordWarning'));
|
||||
ActiveEntry.successMessages.set('password', null);
|
||||
} else {
|
||||
//ActiveEntry.errorMessages.set('password', 'Password present');
|
||||
ActiveEntry.errorMessages.set('password', null);
|
||||
ActiveEntry.successMessages.set('password', 'Password present');
|
||||
}
|
||||
@@ -64,11 +66,15 @@ ActiveEntry.verifyPassword = function (password) {
|
||||
};
|
||||
|
||||
ActiveEntry.verifyConfirmPassword = function (password, confirmPassword) {
|
||||
if (confirmPassword === password) {
|
||||
//ActiveEntry.errorMessages.set('confirm', 'Passwords match');
|
||||
// we have two different logic checks happening in this function
|
||||
// would be reasonable to separate them out into separate functions
|
||||
if (confirmPassword === "") {
|
||||
ActiveEntry.errorMessages.set('confirm', 'Password is required');
|
||||
ActiveEntry.successMessages.set('confirm', null);
|
||||
} else if (confirmPassword === password) {
|
||||
ActiveEntry.errorMessages.set('confirm', null);
|
||||
ActiveEntry.successMessages.set('confirm', 'Passwords match');
|
||||
} else{
|
||||
} else {
|
||||
ActiveEntry.errorMessages.set('confirm', 'Passwords do not match');
|
||||
ActiveEntry.successMessages.set('confirm', null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user