1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-18 15:47:57 +01:00

relax password requirements during registration and change password

This commit is contained in:
Kyle Spearrin 2016-10-10 22:02:17 -04:00
parent 0fb2349a8e
commit 440032ed4a
2 changed files with 4 additions and 9 deletions

View File

@ -13,11 +13,8 @@ angular
$scope.register = function (form) {
var error = false;
if ($scope.model.masterPassword.length < 8 || !/[a-z]/i.test($scope.model.masterPassword) ||
/^[a-zA-Z]*$/.test($scope.model.masterPassword)) {
validationService.addError(form, 'MasterPassword',
'Master password must be at least 8 characters long and contain at least 1 letter and 1 number ' +
'or special character.', true);
if ($scope.model.masterPassword.length < 8) {
validationService.addError(form, 'MasterPassword', 'Master password must be at least 8 characters long.', true);
error = true;
}
if ($scope.model.masterPassword !== $scope.model.confirmMasterPassword) {

View File

@ -7,11 +7,9 @@
$scope.save = function (model, form) {
var error = false;
if ($scope.model.newMasterPassword.length < 8 || !/[a-z]/i.test($scope.model.newMasterPassword) ||
/^[a-zA-Z]*$/.test($scope.model.newMasterPassword)) {
if ($scope.model.newMasterPassword.length < 8) {
validationService.addError(form, 'NewMasterPasswordHash',
'Master password must be at least 8 characters long and contain at least 1 letter and 1 number ' +
'or special character.', true);
'Master password must be at least 8 characters long.', true);
error = true;
}
if ($scope.model.newMasterPassword !== $scope.model.confirmNewMasterPassword) {