From de3995a1ce0a5607ab791d38e882b406e2bb3952 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Fri, 7 Apr 2017 14:47:58 -0400
Subject: Fix possible MFA enforcement redirect loop (#6030)

---
 webapp/root.jsx | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'webapp/root.jsx')

diff --git a/webapp/root.jsx b/webapp/root.jsx
index 98c744477..e28cbfd75 100644
--- a/webapp/root.jsx
+++ b/webapp/root.jsx
@@ -60,6 +60,8 @@ function preRenderSetup(callwhendone) {
     // Make sure the websockets close and reset version
     $(window).on('beforeunload',
          () => {
+             // Turn off to prevent getting stuck in a loop
+             $(window).off('beforeunload');
              BrowserStore.setLastServerVersion('');
              if (UserStore.getCurrentUser()) {
                  AsyncClient.viewChannel('', ChannelStore.getCurrentId() || '');
-- 
cgit v1.2.3-1-g7c22

