mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
Password rules for registration and change.
This commit is contained in:
@@ -11,8 +11,21 @@ angular
|
||||
|
||||
$scope.registerPromise = null;
|
||||
$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);
|
||||
error = true;
|
||||
}
|
||||
if ($scope.model.masterPassword !== $scope.model.confirmMasterPassword) {
|
||||
validationService.addError(form, 'ConfirmMasterPassword', 'Master password confirmation does not match.', true);
|
||||
error = true;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user