Ask old login password on CryptKey decrypt failure, to reseal with new password

This commit is contained in:
the-djmaze 2024-03-18 12:25:24 +01:00
parent a241149b6b
commit 9bc56a5abd
47 changed files with 199 additions and 67 deletions

View file

@ -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) {