mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
only clear memory org keys when locked
This commit is contained in:
@@ -756,7 +756,7 @@ function checkLock() {
|
|||||||
|
|
||||||
if (diffSeconds >= lockOptionSeconds) {
|
if (diffSeconds >= lockOptionSeconds) {
|
||||||
// need to lock now
|
// need to lock now
|
||||||
Q.all([cryptoService.clearKey(), cryptoService.clearOrgKeys()]).then(function () {
|
Q.all([cryptoService.clearKey(), cryptoService.clearOrgKeys(true)]).then(function () {
|
||||||
cryptoService.clearPrivateKey();
|
cryptoService.clearPrivateKey();
|
||||||
setIcon();
|
setIcon();
|
||||||
folderService.clearCache();
|
folderService.clearCache();
|
||||||
|
|||||||
@@ -236,13 +236,18 @@ function initCryptoService(constantsService) {
|
|||||||
_privateKey = null;
|
_privateKey = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
CryptoService.prototype.clearOrgKeys = function () {
|
CryptoService.prototype.clearOrgKeys = function (memoryOnly) {
|
||||||
var deferred = Q.defer();
|
var deferred = Q.defer();
|
||||||
|
|
||||||
_orgKeys = {};
|
_orgKeys = null;
|
||||||
chrome.storage.local.remove('encOrgKeys', function () {
|
if (memoryOnly) {
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
});
|
}
|
||||||
|
else {
|
||||||
|
chrome.storage.local.remove('encOrgKeys', function () {
|
||||||
|
deferred.resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user