mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-17 19:12:40 -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 = [
|
||||
'/ip_ban_appeal',
|
||||
'/vpn_required',
|
||||
'/accounts/banned-response',
|
||||
'/community_guidelines',
|
||||
|
@ -72,6 +73,13 @@ const handleSessionResponse = (dispatch, body) => {
|
|||
) {
|
||||
window.location = '/vpn_required/';
|
||||
return;
|
||||
} else if (
|
||||
body.banned &&
|
||||
body.redirectURL &&
|
||||
banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1)
|
||||
) {
|
||||
window.location = body.redirectURL;
|
||||
return;
|
||||
} else if (
|
||||
body.user &&
|
||||
body.user.banned &&
|
||||
|
|
Loading…
Reference in a new issue