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