From 10200811308c5b857572ed2f66cb510b797a301d Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 6 Jan 2017 18:21:16 -0500 Subject: Prevent reload on MFA page (#5005) --- webapp/client/web_client.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/client/web_client.jsx b/webapp/client/web_client.jsx index 53e199e66..99f30da37 100644 --- a/webapp/client/web_client.jsx +++ b/webapp/client/web_client.jsx @@ -13,6 +13,11 @@ import request from 'superagent'; const HTTP_UNAUTHORIZED = 401; +const mfaPaths = [ + '/mfa/setup', + '/mfa/confirm' +]; + class WebClientClass extends Client { constructor() { super(); @@ -39,7 +44,9 @@ class WebClientClass extends Client { handleError(err, res) { if (res && res.body && res.body.id === 'api.context.mfa_required.app_error') { - window.location.reload(); + if (mfaPaths.indexOf(window.location.pathname) === -1) { + window.location.reload(); + } return; } -- cgit v1.2.3-1-g7c22