mirror of
				https://github.com/nextcloud/passman.git
				synced 2025-10-31 15:56:00 +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
				
			
		|  | @ -215,7 +215,7 @@ angular.module('passmanApp') | ||||||
| 				//@TODO When credential is expired and has renew interval set, calc new expire time.
 | 				//@TODO When credential is expired and has renew interval set, calc new expire time.
 | ||||||
| 				delete $scope.storedCredential.password_repeat; | 				delete $scope.storedCredential.password_repeat; | ||||||
| 				console.log($scope.storedCredential); | 				console.log($scope.storedCredential); | ||||||
| 				if(!$scope.storedCredential.credential_id){ | 				if (!$scope.storedCredential.credential_id) { | ||||||
| 					$scope.storedCredential.vault_id = $scope.active_vault.vault_id; | 					$scope.storedCredential.vault_id = $scope.active_vault.vault_id; | ||||||
| 					CredentialService.createCredential($scope.storedCredential).then(function (result) { | 					CredentialService.createCredential($scope.storedCredential).then(function (result) { | ||||||
| 						$location.path('/vault/' + $routeParams.vault_id); | 						$location.path('/vault/' + $routeParams.vault_id); | ||||||
|  | @ -224,21 +224,25 @@ angular.module('passmanApp') | ||||||
| 				} else { | 				} else { | ||||||
| 
 | 
 | ||||||
| 					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')) { | ||||||
| 						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')){ | 
 | ||||||
|  | 					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