mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
AskPopupView.password default is to only ask passphrase
This commit is contained in:
parent
d198ad5a59
commit
24dbe4f197
3 changed files with 14 additions and 10 deletions
|
|
@ -255,10 +255,14 @@ AskPopupView.password = function(sAskDesc, btnText, ask) {
|
|||
return new Promise(resolve => {
|
||||
this.showModal([
|
||||
sAskDesc,
|
||||
view => resolve({password:view.passphrase(), remember:view.remember()}),
|
||||
view => resolve({
|
||||
password:view.passphrase(),
|
||||
username:/*ask & 2 ? */view.username(),
|
||||
remember:/*ask & 4 ? */view.remember()
|
||||
}),
|
||||
() => resolve(null),
|
||||
true,
|
||||
ask || 5,
|
||||
ask || 1,
|
||||
btnText
|
||||
]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export const Passphrases = new WeakMap();
|
|||
Passphrases.ask = async (key, sAskDesc, btnText) =>
|
||||
Passphrases.has(key)
|
||||
? {password:Passphrases.handle(key)/*, remember:false*/}
|
||||
: await AskPopupView.password(sAskDesc, btnText);
|
||||
: await AskPopupView.password(sAskDesc, btnText, 5);
|
||||
|
||||
const timeouts = {};
|
||||
// get/set accessor to control deletion after 15 minutes of inactivity
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
createSelfSigned() {
|
||||
AskPopupView.password('', 'CRYPTO/CREATE_SELF_SIGNED').then(pass => {
|
||||
if (pass) {
|
||||
AskPopupView.password('', 'CRYPTO/CREATE_SELF_SIGNED').then(result => {
|
||||
if (result) {
|
||||
const identity = this.identity();
|
||||
Remote.request('SMimeCreateCertificate', (iError, oData) => {
|
||||
if (oData.Result.x509) {
|
||||
|
|
@ -60,7 +60,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
name: identity.name(),
|
||||
email: identity.email(),
|
||||
privateKey: identity.smimeKey(),
|
||||
passphrase: pass.password
|
||||
passphrase: result.password
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -70,13 +70,13 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
const identity = this.identity();
|
||||
let old = null
|
||||
if (identity.smimeKeyEncrypted()) {
|
||||
old = await AskPopupView.password(i18n('CRYPTO/CURRENT_PASS'), 'CRYPTO/DECRYPT', 1);
|
||||
old = await AskPopupView.password(i18n('CRYPTO/CURRENT_PASS'), 'CRYPTO/DECRYPT');
|
||||
if (!old) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
AskPopupView.password(i18n('CRYPTO/NEW_PASS'), 'GLOBAL/SAVE', 1).then(pass => {
|
||||
if (pass) {
|
||||
AskPopupView.password(i18n('CRYPTO/NEW_PASS'), 'GLOBAL/SAVE').then(result => {
|
||||
if (result) {
|
||||
Remote.request('SMimeExportPrivateKey', (iError, oData) => {
|
||||
if (oData.Result) {
|
||||
identity.smimeKey(oData.Result);
|
||||
|
|
@ -86,7 +86,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
}, {
|
||||
privateKey: identity.smimeKey(),
|
||||
oldPassphrase: old?.password,
|
||||
newPassphrase: pass.password
|
||||
newPassphrase: result.password
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue