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 &&