mirror of https://github.com/xwiki-labs/cryptpad
clear login token when deleting your account and before logging in
This commit is contained in:
parent
a33774aa6f
commit
d960c10a31
|
@ -463,6 +463,7 @@ define([
|
||||||
var proceed = function (result) {
|
var proceed = function (result) {
|
||||||
hashing = false;
|
hashing = false;
|
||||||
if (test && typeof test === "function" && test()) { return; }
|
if (test && typeof test === "function" && test()) { return; }
|
||||||
|
LocalStore.clearLoginToken();
|
||||||
Realtime.whenRealtimeSyncs(result.realtime, function () {
|
Realtime.whenRealtimeSyncs(result.realtime, function () {
|
||||||
Exports.redirect();
|
Exports.redirect();
|
||||||
});
|
});
|
||||||
|
|
|
@ -82,6 +82,10 @@ define([
|
||||||
} catch (err) { return; }
|
} catch (err) { return; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LocalStore.clearLoginToken = function () {
|
||||||
|
localStorage.removeItem(Constants.loginToken);
|
||||||
|
};
|
||||||
|
|
||||||
LocalStore.setDriveRedirectPreference = function (bool) {
|
LocalStore.setDriveRedirectPreference = function (bool) {
|
||||||
localStorage.setItem(Constants.redirectToDriveKey, Boolean(bool));
|
localStorage.setItem(Constants.redirectToDriveKey, Boolean(bool));
|
||||||
};
|
};
|
||||||
|
|
|
@ -542,12 +542,12 @@ define([
|
||||||
}
|
}
|
||||||
// Owned drive
|
// Owned drive
|
||||||
if (data.state === true) {
|
if (data.state === true) {
|
||||||
sframeChan.query('Q_SETTINGS_LOGOUT', null, function() {});
|
return void sframeChan.query('Q_SETTINGS_LOGOUT_PROPERLY', null, function() {
|
||||||
UI.alert(Messages.settings_deleted, function() {
|
UI.alert(Messages.settings_deleted, function() {
|
||||||
common.gotoURL('/');
|
common.gotoURL('/');
|
||||||
|
});
|
||||||
|
spinner.done();
|
||||||
});
|
});
|
||||||
spinner.done();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// Not owned drive
|
// Not owned drive
|
||||||
var msg = h('div.cp-app-settings-delete-alert', [
|
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) {
|
sframeChan.on('Q_SETTINGS_DRIVE_RESET', function (data, cb) {
|
||||||
Cryptpad.resetDrive(cb);
|
Cryptpad.resetDrive(cb);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue