Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: clear key cache & fix private key encoding in saveInboxKeys() (#9851)

01zulfi79ecbf675275
diff --git a/packages/core/src/api/user-manager.ts b/packages/core/src/api/user-manager.ts
index a884d37c1..411b5fd06 100644
--- a/packages/core/src/api/user-manager.ts
+++ b/packages/core/src/api/user-manager.ts
@@ -538,10 +538,11 @@ class UserManager {
public: keys.publicKey,
private: await this.db
.storage()
- .encrypt(userEncryptionKey, JSON.stringify(keys.privateKey))
+ .encrypt(userEncryptionKey, keys.privateKey)
}
};
await this.updateUser(updatePayload);
+ this.keyManager.clearCache();
}
async sendVerificationEmail(newEmail?: string) {