Handle generic ipban redirect if session says so

This commit is contained in:
Colby Gutierrez-Kraybill 2023-05-09 17:16:37 -04:00
parent 98321a7c9a
commit 5cdafb8bc9

View file

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