mirror of
https://github.com/nextcloud/passman.git
synced 2025-12-19 06:30:01 +08:00
Fix for non shared credentials
This commit is contained in:
parent
4ecbcd9efa
commit
01d07314ff
1 changed files with 11 additions and 7 deletions
|
|
@ -225,20 +225,24 @@ angular.module('passmanApp')
|
||||||
|
|
||||||
var key, _credential;
|
var key, _credential;
|
||||||
if (!$scope.storedCredential.hasOwnProperty('acl') && $scope.storedCredential.hasOwnProperty('shared_key')) {
|
if (!$scope.storedCredential.hasOwnProperty('acl') && $scope.storedCredential.hasOwnProperty('shared_key')) {
|
||||||
|
|
||||||
|
if ($scope.storedCredential.shared_key) {
|
||||||
key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key));
|
key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($scope.storedCredential.hasOwnProperty('acl')) {
|
if ($scope.storedCredential.hasOwnProperty('acl')) {
|
||||||
key = EncryptService.decryptString(angular.copy($scope.storedCredential.acl.shared_key));
|
key = EncryptService.decryptString(angular.copy($scope.storedCredential.acl.shared_key));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
_credential = ShareService.encryptSharedCredential($scope.storedCredential, key);
|
_credential = ShareService.encryptSharedCredential($scope.storedCredential, key);
|
||||||
} else {
|
} else {
|
||||||
_credential = angular.copy($scope.storedCredential);
|
_credential = angular.copy($scope.storedCredential);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete _credential.shared_key;
|
delete _credential.shared_key;
|
||||||
var _useKey = (key != null);
|
var _useKey = (key != null);
|
||||||
console.log(_credential);
|
|
||||||
//Used in activity
|
|
||||||
|
|
||||||
CredentialService.updateCredential(_credential, _useKey).then(function (result) {
|
CredentialService.updateCredential(_credential, _useKey).then(function (result) {
|
||||||
SettingsService.setSetting('edit_credential', null);
|
SettingsService.setSetting('edit_credential', null);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue