diff --git a/src/services/cryptoService.js b/src/services/cryptoService.js index b53c2d22da..a0aeb28679 100644 --- a/src/services/cryptoService.js +++ b/src/services/cryptoService.js @@ -284,13 +284,18 @@ function initCryptoService(constantsService) { return deferred.promise; }; - CryptoService.prototype.clearEncKey = function () { + CryptoService.prototype.clearEncKey = function (memoryOnly) { var deferred = Q.defer(); _encKey = null; - chrome.storage.local.remove('encKey', function () { + if (memoryOnly) { deferred.resolve(); - }); + } + else { + chrome.storage.local.remove('encKey', function () { + deferred.resolve(); + }); + } return deferred.promise; }; diff --git a/src/services/lockService.js b/src/services/lockService.js index 1b74504214..7a0dcccdc5 100644 --- a/src/services/lockService.js +++ b/src/services/lockService.js @@ -73,7 +73,8 @@ function initLockService(self) { return Q.all([ self.cryptoService.clearKey(), self.cryptoService.clearOrgKeys(true), - self.cryptoService.clearPrivateKey(true) + self.cryptoService.clearPrivateKey(true), + self.cryptoService.clearEncKey(true) ]).then(function () { self.setIcon(); self.folderService.clearCache();