Merge pull request #7592 from colbygk/update_for_ipban_redirect

Handle generic ipban redirect if session says so
This commit is contained in:
Alexis Goodfellow 2023-05-09 14:23:47 -07:00 committed by GitHub
commit 4d4b68d061
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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