1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 02:33:46 +00: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

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) {