mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-03 12:27:30 -05:00
Use handleSessionResponse to perform VPN redirect
This commit is contained in:
parent
21a795cd0b
commit
d343b514ba
1 changed files with 6 additions and 8 deletions
|
@ -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 &&
|
||||
|
|
Loading…
Reference in a new issue