diff --git a/js/app/controllers/edit_credential.js b/js/app/controllers/edit_credential.js index f68ccc75..bd061a0f 100644 --- a/js/app/controllers/edit_credential.js +++ b/js/app/controllers/edit_credential.js @@ -211,6 +211,13 @@ angular.module('passmanApp') }; $scope.saveCredential = function () { + + + if ($scope.new_custom_field.label && $scope.new_custom_field.value) { + $scope.storedCredential.custom_fields.push(angular.copy($scope.new_custom_field)); + } + + //@TODO validation //@TODO When credential is expired and has renew interval set, calc new expire time. delete $scope.storedCredential.password_repeat; diff --git a/js/app/controllers/revision.js b/js/app/controllers/revision.js index 1308f550..deefce4c 100644 --- a/js/app/controllers/revision.js +++ b/js/app/controllers/revision.js @@ -55,7 +55,9 @@ angular.module('passmanApp') $scope.selectedRevision = angular.copy(revision); if(!$scope.storedCredential.hasOwnProperty('acl') && $scope.storedCredential.hasOwnProperty('shared_key')){ - key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key)); + if($scope.storedCredential.shared_key) { + key = EncryptService.decryptString(angular.copy($scope.storedCredential.shared_key)); + } } if($scope.storedCredential.hasOwnProperty('acl')){ key = EncryptService.decryptString(angular.copy($scope.storedCredential.acl.shared_key));