clear login token when deleting your account and before logging in

pull/1/head
ansuz 3 years ago
parent a33774aa6f
commit d960c10a31

@ -463,6 +463,7 @@ define([
var proceed = function (result) {
hashing = false;
if (test && typeof test === "function" && test()) { return; }
LocalStore.clearLoginToken();
Realtime.whenRealtimeSyncs(result.realtime, function () {
Exports.redirect();
});

@ -82,6 +82,10 @@ define([
} catch (err) { return; }
};
LocalStore.clearLoginToken = function () {
localStorage.removeItem(Constants.loginToken);
};
LocalStore.setDriveRedirectPreference = function (bool) {
localStorage.setItem(Constants.redirectToDriveKey, Boolean(bool));
};

@ -542,12 +542,12 @@ define([
}
// Owned drive
if (data.state === true) {
sframeChan.query('Q_SETTINGS_LOGOUT', null, function() {});
UI.alert(Messages.settings_deleted, function() {
common.gotoURL('/');
return void sframeChan.query('Q_SETTINGS_LOGOUT_PROPERLY', null, function() {
UI.alert(Messages.settings_deleted, function() {
common.gotoURL('/');
});
spinner.done();
});
spinner.done();
return;
}
// Not owned drive
var msg = h('div.cp-app-settings-delete-alert', [

@ -57,6 +57,10 @@ define([
});
});
});
sframeChan.on('Q_SETTINGS_LOGOUT_PROPERLY', function (data, cb) {
Utils.LocalStore.clearLoginToken();
cb();
});
sframeChan.on('Q_SETTINGS_DRIVE_RESET', function (data, cb) {
Cryptpad.resetDrive(cb);
});

Loading…
Cancel
Save