From 9c8924ee27bdb4fb09343aa5631e478f097f7123 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 22 Mar 2021 18:45:03 +0100 Subject: [PATCH] Fix change password to a previously used value --- www/common/cryptpad-common.js | 3 ++- www/common/outer/async-store.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 7cc19a78c..d653bd72e 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1192,7 +1192,6 @@ define([ } else if (mailbox && typeof(mailbox) === "object") { m = {}; Object.keys(mailbox).forEach(function (ed) { - console.log(mailbox[ed]); try { m[ed] = newCrypto.encrypt(oldCrypto.decrypt(mailbox[ed], true, true)); } catch (e) { @@ -1227,6 +1226,7 @@ define([ cryptgetVal = JSON.stringify(parsed); } }), optsGet); + Cache.clearChannel(newSecret.channel, waitFor()); }).nThen(function (waitFor) { optsPut.metadata.restricted = oldMetadata.restricted; optsPut.metadata.allowed = oldMetadata.allowed; @@ -1608,6 +1608,7 @@ define([ } })); })); + Cache.clearChannel(newSecret.channel, waitFor()); }).nThen(function (waitFor) { // The new rt channel is ready // The blob uses its own encryption and doesn't need to be reencrypted diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 83735de7e..f20a545ec 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -452,7 +452,7 @@ define([ account.note = obj.note; cb(obj); }); - }); + }, Cache); }; //////////////////////////////////////////////////////////////////