mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-26 16:26:44 +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 => {
|
return new Promise(resolve => {
|
||||||
this.showModal([
|
this.showModal([
|
||||||
sAskDesc,
|
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),
|
() => resolve(null),
|
||||||
true,
|
true,
|
||||||
ask || 5,
|
ask || 1,
|
||||||
btnText
|
btnText
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ export const Passphrases = new WeakMap();
|
||||||
Passphrases.ask = async (key, sAskDesc, btnText) =>
|
Passphrases.ask = async (key, sAskDesc, btnText) =>
|
||||||
Passphrases.has(key)
|
Passphrases.has(key)
|
||||||
? {password:Passphrases.handle(key)/*, remember:false*/}
|
? {password:Passphrases.handle(key)/*, remember:false*/}
|
||||||
: await AskPopupView.password(sAskDesc, btnText);
|
: await AskPopupView.password(sAskDesc, btnText, 5);
|
||||||
|
|
||||||
const timeouts = {};
|
const timeouts = {};
|
||||||
// get/set accessor to control deletion after 15 minutes of inactivity
|
// get/set accessor to control deletion after 15 minutes of inactivity
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ export class IdentityPopupView extends AbstractViewPopup {
|
||||||
}
|
}
|
||||||
|
|
||||||
createSelfSigned() {
|
createSelfSigned() {
|
||||||
AskPopupView.password('', 'CRYPTO/CREATE_SELF_SIGNED').then(pass => {
|
AskPopupView.password('', 'CRYPTO/CREATE_SELF_SIGNED').then(result => {
|
||||||
if (pass) {
|
if (result) {
|
||||||
const identity = this.identity();
|
const identity = this.identity();
|
||||||
Remote.request('SMimeCreateCertificate', (iError, oData) => {
|
Remote.request('SMimeCreateCertificate', (iError, oData) => {
|
||||||
if (oData.Result.x509) {
|
if (oData.Result.x509) {
|
||||||
|
|
@ -60,7 +60,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
||||||
name: identity.name(),
|
name: identity.name(),
|
||||||
email: identity.email(),
|
email: identity.email(),
|
||||||
privateKey: identity.smimeKey(),
|
privateKey: identity.smimeKey(),
|
||||||
passphrase: pass.password
|
passphrase: result.password
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -70,13 +70,13 @@ export class IdentityPopupView extends AbstractViewPopup {
|
||||||
const identity = this.identity();
|
const identity = this.identity();
|
||||||
let old = null
|
let old = null
|
||||||
if (identity.smimeKeyEncrypted()) {
|
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) {
|
if (!old) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AskPopupView.password(i18n('CRYPTO/NEW_PASS'), 'GLOBAL/SAVE', 1).then(pass => {
|
AskPopupView.password(i18n('CRYPTO/NEW_PASS'), 'GLOBAL/SAVE').then(result => {
|
||||||
if (pass) {
|
if (result) {
|
||||||
Remote.request('SMimeExportPrivateKey', (iError, oData) => {
|
Remote.request('SMimeExportPrivateKey', (iError, oData) => {
|
||||||
if (oData.Result) {
|
if (oData.Result) {
|
||||||
identity.smimeKey(oData.Result);
|
identity.smimeKey(oData.Result);
|
||||||
|
|
@ -86,7 +86,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
||||||
}, {
|
}, {
|
||||||
privateKey: identity.smimeKey(),
|
privateKey: identity.smimeKey(),
|
||||||
oldPassphrase: old?.password,
|
oldPassphrase: old?.password,
|
||||||
newPassphrase: pass.password
|
newPassphrase: result.password
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue