1
0
mirror of https://github.com/bitwarden/web synced 2026-01-08 03:23:29 +00:00

purge vault

This commit is contained in:
Kyle Spearrin
2017-10-25 21:46:35 -04:00
parent a57110b935
commit f3eaf644b0
6 changed files with 72 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
angular
.module('bit.settings')
.controller('settingsPurgeController', function ($scope, $state, apiService, $uibModalInstance, cryptoService,
authService, toastr, $analytics, tokenService) {
$analytics.eventTrack('settingsPurgeController', { category: 'Modal' });
$scope.submit = function (model) {
$scope.submitPromise = cryptoService.hashPassword(model.masterPassword).then(function (hash) {
return apiService.ciphers.purge({
masterPasswordHash: hash
}).$promise;
}).then(function () {
$uibModalInstance.dismiss('cancel');
$analytics.eventTrack('Purged Vault');
return $state.go('backend.user.vault', { refreshFromServer: true });
}).then(function () {
toastr.success('All items in your vault have been deleted.', 'Vault Purged');
});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});