mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-06 03:34:54 +08:00
Update files to reflect the api change
This commit is contained in:
parent
370b9b832e
commit
4463fa7d3c
4 changed files with 48 additions and 40 deletions
|
@ -27,6 +27,42 @@ angular.module('passmanApp')
|
|||
|
||||
}
|
||||
|
||||
|
||||
$scope.show_spinner = true;
|
||||
|
||||
|
||||
var fetchCredentials = function () {
|
||||
VaultService.getVault($scope.active_vault).then(function (vault) {
|
||||
$scope.active_vault = angular.merge($scope.active_vault, vault);
|
||||
var _credentials = [];
|
||||
for (var i = 0; i < $scope.active_vault.credentials.length; i++) {
|
||||
try {
|
||||
$scope.active_vault.credentials[i] = CredentialService.decryptCredential(angular.copy(vault.credentials[i]));
|
||||
} catch (e) {
|
||||
NotificationService.showNotification('An error happend during decryption', 5000);
|
||||
$rootScope.$broadcast('logout');
|
||||
SettingsService.setSetting('defaultVaultPass', null);
|
||||
SettingsService.setSetting('defaultVault', null);
|
||||
$location.path('/')
|
||||
|
||||
}
|
||||
if ($scope.active_vault.credentials[i]) {
|
||||
TagService.addTags($scope.active_vault.credentials[i].tags);
|
||||
|
||||
}
|
||||
}
|
||||
$scope.show_spinner = false;
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
if ($scope.active_vault) {
|
||||
$scope.$parent.selectedVault = true;
|
||||
fetchCredentials();
|
||||
}
|
||||
|
||||
|
||||
|
||||
$scope.addCredential = function () {
|
||||
var new_credential = CredentialService.newCredential();
|
||||
var enc_c = CredentialService.encryptCredential(new_credential);
|
||||
|
@ -201,40 +237,6 @@ angular.module('passmanApp')
|
|||
|
||||
});
|
||||
|
||||
$scope.show_spinner = true;
|
||||
|
||||
|
||||
var fetchCredentials = function () {
|
||||
VaultService.getVault($scope.active_vault).then(function (credentials) {
|
||||
var _credentials = [];
|
||||
for (var i = 0; i < credentials.length; i++) {
|
||||
try {
|
||||
var _c = CredentialService.decryptCredential(angular.copy(credentials[i]));
|
||||
} catch (e) {
|
||||
NotificationService.showNotification('An error happend during decryption', 5000);
|
||||
$rootScope.$broadcast('logout');
|
||||
SettingsService.setSetting('defaultVaultPass', null);
|
||||
SettingsService.setSetting('defaultVault', null);
|
||||
$location.path('/')
|
||||
|
||||
}
|
||||
if (_c) {
|
||||
_c.tags_raw = _c.tags;
|
||||
TagService.addTags(_c.tags);
|
||||
_credentials.push(_c);
|
||||
}
|
||||
}
|
||||
$scope.credentials = _credentials;
|
||||
$scope.show_spinner = false;
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
if ($scope.active_vault) {
|
||||
$scope.$parent.selectedVault = true;
|
||||
fetchCredentials();
|
||||
}
|
||||
|
||||
|
||||
$scope.downloadFile = function (file) {
|
||||
FileService.getFile(file).then(function (result) {
|
||||
|
|
|
@ -85,9 +85,9 @@ angular.module('passmanApp')
|
|||
});
|
||||
|
||||
$scope.startScan = function (minStrength) {
|
||||
VaultService.getVault($scope.active_vault).then(function (credentials) {
|
||||
VaultService.getVault($scope.active_vault).then(function (vault) {
|
||||
var results = [];
|
||||
for (var i = 0; i < credentials.length; i++) {
|
||||
for (var i = 0; i < vault.credentials.length; i++) {
|
||||
var c = CredentialService.decryptCredential(angular.copy(credentials[i]));
|
||||
if (c.password && c.password.length > 0 && c.hidden == 0) {
|
||||
var zxcvbn_result = zxcvbn(c.password);
|
||||
|
|
|
@ -99,8 +99,8 @@ angular.module('passmanApp')
|
|||
var _vault = angular.copy(vault);
|
||||
_vault.vaultKey = angular.copy(vault_key);
|
||||
VaultService.setActiveVault(_vault);
|
||||
VaultService.getVault(vault).then(function (credentials) {
|
||||
var credential = credentials[0];
|
||||
VaultService.getVault(vault).then(function (vault) {
|
||||
var credential = vault.credentials[0];
|
||||
try {
|
||||
var c = CredentialService.decryptCredential(credential);
|
||||
if ($scope.remember_vault_password) {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue