Fixed websocket to properly logout when logged out from another tab (#4546)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
db0314053e
Коммит
814d2fc88d
@@ -461,21 +461,23 @@ export function emitRemoteUserTypingEvent(channelId, userId, postParentId) {
|
||||
});
|
||||
}
|
||||
|
||||
export function emitUserLoggedOutEvent(redirectTo) {
|
||||
const rURL = (redirectTo && typeof redirectTo === 'string') ? redirectTo : '/';
|
||||
export function emitUserLoggedOutEvent(redirectTo = '/', shouldSignalLogout = true) {
|
||||
Client.logout(
|
||||
() => {
|
||||
BrowserStore.signalLogout();
|
||||
if (shouldSignalLogout) {
|
||||
BrowserStore.signalLogout();
|
||||
}
|
||||
|
||||
BrowserStore.clear();
|
||||
ErrorStore.clearLastError();
|
||||
PreferenceStore.clear();
|
||||
UserStore.clear();
|
||||
TeamStore.clear();
|
||||
newLocalizationSelected(global.window.mm_config.DefaultClientLocale);
|
||||
browserHistory.push(rURL);
|
||||
browserHistory.push(redirectTo);
|
||||
},
|
||||
() => {
|
||||
browserHistory.push(rURL);
|
||||
browserHistory.push(redirectTo);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user