mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
after changing password, encryption key changed so current encryption session is invalid and needs to be cleared
This commit is contained in:
parent
5b84487aac
commit
4e298d9d85
@ -115,22 +115,26 @@ $("#encryptionPasswordForm").submit(function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
setInterval(function() {
|
||||
if (globalLastEncryptionOperationDate !== null && new Date().getTime() - globalLastEncryptionOperationDate.getTime() > globalEncryptionSessionTimeout * 1000) {
|
||||
globalEncryptionKey = null;
|
||||
function resetEncryptionSession() {
|
||||
globalEncryptionKey = null;
|
||||
|
||||
if (globalCurrentNote.detail.encryption > 0) {
|
||||
loadNote(globalCurrentNote.detail.note_id);
|
||||
if (globalCurrentNote.detail.encryption > 0) {
|
||||
loadNote(globalCurrentNote.detail.note_id);
|
||||
|
||||
for (const noteId of globalAllNoteIds) {
|
||||
const note = getNodeByKey(noteId);
|
||||
for (const noteId of globalAllNoteIds) {
|
||||
const note = getNodeByKey(noteId);
|
||||
|
||||
if (note.data.encryption > 0) {
|
||||
note.setTitle("[encrypted]");
|
||||
}
|
||||
if (note.data.encryption > 0) {
|
||||
note.setTitle("[encrypted]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setInterval(function() {
|
||||
if (globalLastEncryptionOperationDate !== null && new Date().getTime() - globalLastEncryptionOperationDate.getTime() > globalEncryptionSessionTimeout * 1000) {
|
||||
resetEncryptionSession();
|
||||
}
|
||||
}, 5000);
|
||||
|
||||
function isEncryptionAvailable() {
|
||||
|
@ -40,6 +40,9 @@ $("#changePasswordForm").submit(() => {
|
||||
contentType: "application/json",
|
||||
success: function (result) {
|
||||
if (result.success) {
|
||||
// encryption password changed so current encryption session is invalid and needs to be cleared
|
||||
resetEncryptionSession();
|
||||
|
||||
alert("Password has been changed.");
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user