You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
Cli: Ask for master password when encryption or decryption fails
This commit is contained in:
@ -340,3 +340,17 @@ export async function masterPasswordIsValid(masterPassword: string, activeMaster
|
||||
// compare to whatever they've entered earlier.
|
||||
return Setting.value('encryption.masterPassword') === masterPassword;
|
||||
}
|
||||
|
||||
export async function masterKeysWithoutPassword(): Promise<string[]> {
|
||||
const syncInfo = localSyncInfo();
|
||||
const passwordCache = Setting.value('encryption.passwordCache');
|
||||
|
||||
const output: string[] = [];
|
||||
for (const mk of syncInfo.masterKeys) {
|
||||
if (!masterKeyEnabled(mk)) continue;
|
||||
const password = await findMasterKeyPassword(EncryptionService.instance(), mk, passwordCache);
|
||||
if (!password) output.push(mk.id);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
Reference in New Issue
Block a user