Add an option to store(and delete) encrypted private key passphrase in the browser across multiple sessions

This commit is contained in:
Sergey Mosin 2024-12-09 11:18:41 -05:00
parent 486acde2e3
commit 5973d71e2f
13 changed files with 227 additions and 18 deletions

View file

@ -15,10 +15,14 @@ export class AskPopupView extends AbstractViewPopup {
askUsername: false,
passphrase: '',
askPass: false,
remember: true,
askRemeber: false
remember: true, // remember for session
askRemeber: false,
rememberPermanent: false,
askRememberPermanent: false,
});
this.rememberPermanent.subscribe(value => value && this.remember(true));
this.fYesAction = null;
this.fNoAction = null;
@ -48,10 +52,12 @@ export class AskPopupView extends AbstractViewPopup {
this.askDesc(sAskDesc || '');
this.askUsername(ask & 2);
this.askPass(ask & 1);
this.askRemeber(ask & 4);
this.askRemeber(ask & 4); // 0b0100
this.askRememberPermanent(ask & 0b1000)
this.username('');
this.passphrase('');
this.remember(true);
this.rememberPermanent(false);
this.yesButton(i18n(btnText || 'GLOBAL/YES'));
this.noButton(i18n(ask ? 'GLOBAL/CANCEL' : 'GLOBAL/NO'));
this.fYesAction = fYesFunc;

View file

@ -1592,6 +1592,7 @@ export class ComposePopupView extends AbstractViewPopup {
*/
break;
} catch (e) {
Passphrases.delete(signOptions[i][1])
console.error(e);
}
} else if ('GnuPG' == signOptions[i][0]) {