1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

cleanup of pwned password checker

This commit is contained in:
Kyle Spearrin 2018-02-28 11:49:25 -05:00
parent e12ecb0c14
commit ced108d1a6
4 changed files with 28 additions and 26 deletions

2
jslib

@ -1 +1 @@
Subproject commit 902d72457cbeb99ef5d9eb69945ad43658f69277
Subproject commit e3b3e444dbff7e4541fa5367ee26bc7ed4d73b26

View File

@ -982,12 +982,12 @@
"message": "Complete your two-step login request using the new tab."
},
"checkPassword": {
"message": "Check if the password have been previously exposed."
"message": "Check if password has been exposed."
},
"passwordExposed": {
"message": "This password have been previously exposed in data breaches!"
"message": "This password has been exposed in data breaches. You should change it."
},
"passwordSafe": {
"message": "This password was not found in a current data breach! It should be safe to use."
"message": "This password was not found in any known data breaches. It should be safe to use."
}
}

View File

@ -94,18 +94,19 @@ angular
$scope.showPassword = !$scope.showPassword;
};
$scope.checkPassword = () => {
$analytics.eventTrack('Check Password');
$scope.checkPassword = function () {
if (!$scope.cipher.login || !$scope.cipher.login.password || $scope.cipher.login.password === '') {
return;
}
auditService
.passwordLeaked($scope.cipher.login.password)
.then((matches) => {
if (matches != 0) {
toastr.error(i18nService.passwordExposed, i18nService.errorsOccurred);
} else {
toastr.success(i18nService.passwordSafe)
}
})
$analytics.eventTrack('Check Password');
auditService.passwordLeaked($scope.cipher.login.password).then(function (matches) {
if (matches != 0) {
toastr.error(i18nService.passwordExposed);
} else {
toastr.success(i18nService.passwordSafe);
}
});
};
$scope.addField = function (type) {

View File

@ -112,18 +112,19 @@ angular
$scope.showPassword = !$scope.showPassword;
};
$scope.checkPassword = () => {
$analytics.eventTrack('Check Password');
$scope.checkPassword = function () {
if (!$scope.cipher.login || !$scope.cipher.login.password || $scope.cipher.login.password === '') {
return;
}
auditService
.passwordLeaked($scope.cipher.login.password)
.then((matches) => {
if (matches != 0) {
toastr.error(i18nService.passwordExposed, i18nService.errorsOccurred);
} else {
toastr.success(i18nService.passwordSafe)
}
})
$analytics.eventTrack('Check Password');
auditService.passwordLeaked($scope.cipher.login.password).then(function (matches) {
if (matches != 0) {
toastr.error(i18nService.passwordExposed);
} else {
toastr.success(i18nService.passwordSafe);
}
});
};
$scope.addField = function (type) {