Fix for non shared credentials

This commit is contained in:
brantje 2016-10-05 19:32:37 +02:00
parent 4ecbcd9efa
commit 01d07314ff
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F

View file

@ -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);