mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: invalid session error modal during logout
A brief flash can be seen, but this is exacerbated by slow connections and/or slow server response.
This commit is contained in:
@@ -6,6 +6,7 @@ app = window.app || {};
|
||||
app.isFocused = true;
|
||||
app.currentRoom = null;
|
||||
app.widgets = {};
|
||||
app.flags = {};
|
||||
app.cacheBuster = null;
|
||||
|
||||
(function () {
|
||||
@@ -117,6 +118,9 @@ app.cacheBuster = null;
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token,
|
||||
},
|
||||
beforeSend: function () {
|
||||
app.flags._logout = true;
|
||||
},
|
||||
success: function (data) {
|
||||
$(window).trigger('action:app.loggedOut', data);
|
||||
if (redirect) {
|
||||
@@ -169,6 +173,10 @@ app.cacheBuster = null;
|
||||
};
|
||||
|
||||
app.handleInvalidSession = function () {
|
||||
if (app.flags._logout) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket.disconnect();
|
||||
bootbox.alert({
|
||||
title: '[[error:invalid-session]]',
|
||||
|
||||
Reference in New Issue
Block a user