mirror of https://github.com/laurent22/joplin.git
CLI: confirm encryption password (#1937)
Successful flow: https://gyazo.com/354ca9ea412ffe3756ee77938d544341 Flow with error (non-matching passwords): https://gyazo.com/9adda69278e3631da33d9fb366815d04pull/1941/head
parent
0fb5b35212
commit
438c448ef7
|
@ -50,7 +50,15 @@ class Command extends BaseCommand {
|
||||||
this.stdout(_('Operation cancelled'));
|
this.stdout(_('Operation cancelled'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const password2 = await this.prompt(_('Confirm master password:'), { type: 'string', secure: true });
|
||||||
|
if (!password2) {
|
||||||
|
this.stdout(_('Operation cancelled'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (password !== password2) {
|
||||||
|
this.stdout(_('Passwords did not match!'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
await EncryptionService.instance().generateMasterKeyAndEnableEncryption(password);
|
await EncryptionService.instance().generateMasterKeyAndEnableEncryption(password);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue