From d343b514ba410e371c2b9cb77706f76890aa094e Mon Sep 17 00:00:00 2001 From: Colby Gutierrez-Kraybill Date: Thu, 9 Feb 2023 19:04:37 -0500 Subject: [PATCH] Use handleSessionResponse to perform VPN redirect --- src/redux/session.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/redux/session.js b/src/redux/session.js index 36e5091d8..e592465c5 100644 --- a/src/redux/session.js +++ b/src/redux/session.js @@ -65,22 +65,20 @@ module.exports.setStatus = status => ({ }); const handleSessionResponse = (dispatch, body) => { - console.log(window.location.pathname); if (typeof body === 'undefined') return dispatch(module.exports.setSessionError('No session content')); if ( + body.vpn_required && + banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1) + ) { + window.location = '/vpn_required/'; + return; + } else if ( body.user && body.user.banned && banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1) ) { window.location = '/accounts/banned-response/'; return; - } else if ( - body.flags && - body.flags.vpn_required && - banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1) - ) { - window.location = '/vpn_required/'; - return; } else if ( body.flags && body.flags.must_complete_registration &&