mirror of
https://github.com/bitwarden/web
synced 2025-12-06 00:03:28 +00:00
25 lines
1.0 KiB
JavaScript
25 lines
1.0 KiB
JavaScript
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');
|
|
};
|
|
});
|