mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Ask old login password on CryptKey decrypt failure, to reseal with new password
This commit is contained in:
parent
a241149b6b
commit
9bc56a5abd
47 changed files with 199 additions and 67 deletions
|
|
@ -132,7 +132,7 @@ export class AbstractFetchRemote
|
|||
fetchJSON(sAction, getURL(sGetAdd),
|
||||
sGetAdd ? null : (params || {}),
|
||||
undefined === iTimeout ? 30000 : pInt(iTimeout),
|
||||
data => {
|
||||
async data => {
|
||||
let iError = 0;
|
||||
if (data) {
|
||||
/*
|
||||
|
|
@ -148,6 +148,10 @@ export class AbstractFetchRemote
|
|||
}
|
||||
}
|
||||
|
||||
if (111 === iError && rl.app.ask && await rl.app.ask.cryptkey()) {
|
||||
return this.request(sAction, fCallback, params, iTimeout, sGetAdd);
|
||||
}
|
||||
|
||||
fCallback && fCallback(
|
||||
iError,
|
||||
data,
|
||||
|
|
@ -185,12 +189,16 @@ export class AbstractFetchRemote
|
|||
post(action, fTrigger, params, timeOut) {
|
||||
this.setTrigger(fTrigger, true);
|
||||
return fetchJSON(action, getURL(), params || {}, pInt(timeOut, 30000),
|
||||
data => {
|
||||
async data => {
|
||||
abort(action, 0, 1);
|
||||
|
||||
if (!data) {
|
||||
return Promise.reject(new FetchError(Notifications.JsonParse));
|
||||
}
|
||||
|
||||
if (111 === data?.ErrorCode && rl.app.ask && await rl.app.ask.cryptkey()) {
|
||||
return this.post(action, fTrigger, params, timeOut);
|
||||
}
|
||||
/*
|
||||
let isCached = false, type = '';
|
||||
if (data?.epoch) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue