mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-11 16:21:04 -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) => {
|
const handleSessionResponse = (dispatch, body) => {
|
||||||
console.log(window.location.pathname);
|
|
||||||
if (typeof body === 'undefined') return dispatch(module.exports.setSessionError('No session content'));
|
if (typeof body === 'undefined') return dispatch(module.exports.setSessionError('No session content'));
|
||||||
if (
|
if (
|
||||||
|
body.vpn_required &&
|
||||||
|
banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1)
|
||||||
|
) {
|
||||||
|
window.location = '/vpn_required/';
|
||||||
|
return;
|
||||||
|
} else if (
|
||||||
body.user &&
|
body.user &&
|
||||||
body.user.banned &&
|
body.user.banned &&
|
||||||
banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1)
|
banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1)
|
||||||
) {
|
) {
|
||||||
window.location = '/accounts/banned-response/';
|
window.location = '/accounts/banned-response/';
|
||||||
return;
|
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 (
|
} else if (
|
||||||
body.flags &&
|
body.flags &&
|
||||||
body.flags.must_complete_registration &&
|
body.flags.must_complete_registration &&
|
||||||
|
|
Loading…
Reference in a new issue