summaryrefslogtreecommitdiffstats
path: root/webapp/utils/client.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-30 11:07:03 -0400
committerChristopher Speller <crspeller@gmail.com>2016-03-30 15:29:21 -0400
commitbf90d98136965dfd37546e5ecb23d8c6970bed8a (patch)
treeb2c3944a2a33d20cc566318ab44aa12eecd51d8d /webapp/utils/client.jsx
parent8283c18cb0ab3ef7a07f6a6f2d5ae61c109dae96 (diff)
downloadchat-bf90d98136965dfd37546e5ecb23d8c6970bed8a.tar.gz
chat-bf90d98136965dfd37546e5ecb23d8c6970bed8a.tar.bz2
chat-bf90d98136965dfd37546e5ecb23d8c6970bed8a.zip
Fixing session and logout errors
Diffstat (limited to 'webapp/utils/client.jsx')
-rw-r--r--webapp/utils/client.jsx8
1 files changed, 2 insertions, 6 deletions
diff --git a/webapp/utils/client.jsx b/webapp/utils/client.jsx
index a596d1e14..854aa31dc 100644
--- a/webapp/utils/client.jsx
+++ b/webapp/utils/client.jsx
@@ -50,12 +50,8 @@ function handleError(methodName, xhr, status, err) {
track('api', 'api_weberror', methodName, 'message', msg);
if (xhr.status === 401) {
- if (window.location.href.indexOf('/channels') === 0) {
- browserHistory.push('/login?extra=expired&redirect=' + encodeURIComponent(window.location.pathname + window.location.search));
- } else {
- var teamURL = window.location.pathname.split('/channels')[0];
- browserHistory.push(teamURL + '/login?extra=expired&redirect=' + encodeURIComponent(window.location.pathname + window.location.search));
- }
+ const team = window.location.pathname.split('/')[1];
+ browserHistory.push('/' + team + '/login?extra=expired&redirect=' + encodeURIComponent(window.location.pathname + window.location.search));
}
return e;