Fix broken redirect on account password change

This commit is contained in:
yflory 2023-07-19 15:20:28 +02:00
parent 880fd3383f
commit bc7e4b8918
5 changed files with 10 additions and 6 deletions

View File

@ -390,7 +390,7 @@ define([
});
};
common.stopWorker = function () {
postMessage('STOPWORKER', null, function () {});
postMessage('STOPWORKER');
};
common.logoutFromAll = function (cb) {
var token = Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);
@ -2073,7 +2073,7 @@ define([
return;
}
common.logoutFromAll(waitFor(function () {
postMessage("DISCONNECT");
common.stopWorker();
}));
}));
}).nThen(function (waitFor) {
@ -2088,7 +2088,7 @@ define([
console.error(obj.error);
}
common.logoutFromAll(waitFor(function () {
postMessage("DISCONNECT");
common.stopWorker();
}));
}));
}).nThen(function () {
@ -2790,7 +2790,7 @@ define([
});
LocalStore.onLogout(function () {
console.log('onLogout: disconnect');
postMessage("DISCONNECT");
common.stopWorker();
});
}).nThen(function (waitFor) {
if (common.migrateAnonDrive || sessionStorage.migrateAnonDrive) {

View File

@ -31,6 +31,7 @@ define([
});
});
chan.on('STOPWORKER', function (data, cb) {
Rpc.queries['DISCONNECT'](clientId, data, cb);
cb();
});
chan.on('CONNECT', function (cfg, cb) {

View File

@ -72,7 +72,7 @@ var init = function (client, cb) {
}
});
});
chan.on('STOPWORKER', function (data, cb) {
chan.on('STOPWORKER', function () {
self.close();
});
chan.on('CONNECT', function (cfg, cb) {

View File

@ -28,6 +28,7 @@ require(['/api/config?cb=' + (+new Date()).toString(16)], function (ApiConfig) {
if (q === 'CONNECT') { return; }
if (q === 'JOIN_PAD') { return; }
if (q === 'SEND_PAD_MSG') { return; }
if (q === 'STOPWORKER') { return; }
chan.on(q, function (data, cb) {
try {
Rpc.queries[q](clientId, data, cb);
@ -38,6 +39,9 @@ require(['/api/config?cb=' + (+new Date()).toString(16)], function (ApiConfig) {
}
});
});
chan.on('STOPWORKER', function () {
self.close();
});
chan.on('CONNECT', function (cfg, cb) {
// load Store here, with cfg, and pass a "query" (chan.query)
// cId is a clientId used in ServiceWorker or SharedWorker

View File

@ -1343,7 +1343,6 @@ define([
});
sframeChan.on('Q_LOGOUT', function (data, cb) {
Cryptpad.stopWorker();
Utils.LocalStore.logout(cb);
});