diff options
author | brantje <brantje@gmail.com> | 2016-09-14 00:03:12 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2016-09-14 00:03:12 +0300 |
commit | f37226d8cda684ebdf9dd720348f89ea014dc646 (patch) | |
tree | 09883dfe2657eaa64be8a2f36f68e422f0801948 /js/app/services/credentialservice.js | |
parent | 79914272a72a6f11b704b582122e288318ad0bae (diff) |
Add otp tab, add files tab
Diffstat (limited to 'js/app/services/credentialservice.js')
-rw-r--r-- | js/app/services/credentialservice.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/js/app/services/credentialservice.js b/js/app/services/credentialservice.js index 2881ff18..96892493 100644 --- a/js/app/services/credentialservice.js +++ b/js/app/services/credentialservice.js @@ -28,7 +28,7 @@ angular.module('passmanApp') 'delete_time': 0, 'files': [], 'custom_fields': [], - 'otp': null, + 'otp': {}, 'hidden': false }; var _encryptedFields = ['description','username','password','files','custom_fields','otp']; @@ -68,6 +68,14 @@ angular.module('passmanApp') } }); }, + encryptCredential: function (credential) { + for(var i = 0; i < _encryptedFields.length; i++){ + var field = _encryptedFields[i]; + var fieldValue = angular.copy(credential[field]); + credential[field] = EncryptService.encryptString(JSON.stringify(fieldValue)); + } + return credential; + }, decryptCredential: function (credential) { for(var i = 0; i < _encryptedFields.length; i++){ var field = _encryptedFields[i]; |