diff --git a/src/popup/app/vault/vaultViewCipherController.js b/src/popup/app/vault/vaultViewCipherController.js index a91ff2e5ba..40c53da470 100644 --- a/src/popup/app/vault/vaultViewCipherController.js +++ b/src/popup/app/vault/vaultViewCipherController.js @@ -2,8 +2,8 @@ angular .module('bit.vault') .controller('vaultViewCipherController', function ($scope, $state, $stateParams, cipherService, toastr, - $analytics, i18nService, platformUtilsService, totpService, $timeout, tokenService, $window, cryptoService, SweetAlert, - constantsService) { + $analytics, i18nService, platformUtilsService, totpService, $timeout, tokenService, $window, cryptoService, + SweetAlert, constantsService, auditService) { $scope.constants = constantsService; $scope.i18n = i18nService; $scope.showAttachments = !platformUtilsService.isEdge(); @@ -184,6 +184,21 @@ angular }); } + $scope.checkPassword = function () { + if (!$scope.cipher.login || !$scope.cipher.login.password || $scope.cipher.login.password === '') { + return; + } + + $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); + } + }); + }; + function totpTick() { $timeout(function () { var epoch = Math.round(new Date().getTime() / 1000.0); diff --git a/src/popup/app/vault/views/vaultViewCipher.html b/src/popup/app/vault/views/vaultViewCipher.html index b3470e31cb..82ff3baa87 100644 --- a/src/popup/app/vault/views/vaultViewCipher.html +++ b/src/popup/app/vault/views/vaultViewCipher.html @@ -34,6 +34,9 @@
+ + +