Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorbinsky <timo@binsky.org>2021-10-23 20:59:13 +0300
committerbinsky <timo@binsky.org>2021-10-23 20:59:13 +0300
commitd9815b3ca3bdd4c4ce59cc3ae03bd64b607de042 (patch)
treedb7a1fba69b0fa48c80d879ff8861d9463cb4886 /js
parente9f0beb0a61c71cc19be409d7b2e1126897d580a (diff)
do not collect all credential guids for vault deletion; use custom file mass deletion endpoint
Signed-off-by: binsky <timo@binsky.org>
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/settings.js4
-rw-r--r--js/app/services/vaultservice.js9
2 files changed, 5 insertions, 8 deletions
diff --git a/js/app/controllers/settings.js b/js/app/controllers/settings.js
index 31d4a0a8..21caea4a 100644
--- a/js/app/controllers/settings.js
+++ b/js/app/controllers/settings.js
@@ -283,17 +283,15 @@
total: vault.credentials.length,
};
- var credential_guids = [];
var file_ids = [];
for (const credential of credentials) {
- credential_guids.push(credential.guid);
var decryptedFiles = JSON.parse(EncryptService.decryptString(angular.copy(credential.files), VaultService.getActiveVault().vaultKey));
for (const file of decryptedFiles) {
file_ids.push(file.file_id);
}
}
- VaultService.deleteVault(vault, credential_guids, file_ids).then(function () {
+ VaultService.deleteVault(vault, file_ids).then(function () {
SettingsService.setSetting('defaultVaultPass', false);
SettingsService.setSetting('defaultVault', null);
$rootScope.$broadcast('logout');
diff --git a/js/app/services/vaultservice.js b/js/app/services/vaultservice.js
index 79809b6e..188f7c06 100644
--- a/js/app/services/vaultservice.js
+++ b/js/app/services/vaultservice.js
@@ -122,14 +122,13 @@
}
});
},
- deleteVault: function (vault, credential_guids, file_ids) {
+ deleteVault: function (vault, file_ids) {
var queryUrl = OC.generateUrl('apps/passman/api/v2/vaults/' + vault.guid);
- var deleteContentUrl = OC.generateUrl('apps/passman/api/v2/vaults/delete-vault-content');
- var data = {
- "credential_guids": JSON.stringify(credential_guids),
+ var deleteFilesUrl = OC.generateUrl('apps/passman/api/v2/files/delete');
+ var filesData = {
"file_ids": JSON.stringify(file_ids)
};
- return $http.post(deleteContentUrl, data).then(function () {
+ return $http.post(deleteFilesUrl, filesData).then(function () {
return $http.delete(queryUrl).then(function (response) {
if (response.data) {
return response.data;