mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 17:45:52 -05:00
Handle generic ipban redirect if session says so
This commit is contained in:
parent
98321a7c9a
commit
5cdafb8bc9
1 changed files with 8 additions and 0 deletions
|
@ -13,6 +13,7 @@ const Types = keyMirror({
|
||||||
});
|
});
|
||||||
|
|
||||||
const banGoodListPaths = [
|
const banGoodListPaths = [
|
||||||
|
'/ip_ban_appeal',
|
||||||
'/vpn_required',
|
'/vpn_required',
|
||||||
'/accounts/banned-response',
|
'/accounts/banned-response',
|
||||||
'/community_guidelines',
|
'/community_guidelines',
|
||||||
|
@ -72,6 +73,13 @@ const handleSessionResponse = (dispatch, body) => {
|
||||||
) {
|
) {
|
||||||
window.location = '/vpn_required/';
|
window.location = '/vpn_required/';
|
||||||
return;
|
return;
|
||||||
|
} else if (
|
||||||
|
body.banned &&
|
||||||
|
body.redirectURL &&
|
||||||
|
banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1)
|
||||||
|
) {
|
||||||
|
window.location = body.redirectURL;
|
||||||
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
body.user &&
|
body.user &&
|
||||||
body.user.banned &&
|
body.user.banned &&
|
||||||
|
|
Loading…
Reference in a new issue