From 3156976fee92a0bad5480e4bf815db3aa34303a1 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Wed, 5 May 2021 16:50:54 -0400 Subject: [PATCH] update method of checking goodlist of pages for banned user to see --- src/redux/session.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/redux/session.js b/src/redux/session.js index 0ee0edd82..a9886ebfe 100644 --- a/src/redux/session.js +++ b/src/redux/session.js @@ -12,10 +12,11 @@ const Types = keyMirror({ SET_STATUS: null }); -const banWhitelistPaths = [ - '/accounts/banned-response/', - '/community_guidelines/', - '/community_guidelines' +const banGoodListPaths = [ + '/accounts/banned-response', + '/community_guidelines', + '/privacy_policy', + '/terms_of_use' ]; module.exports.Status = keyMirror({ @@ -67,7 +68,7 @@ const handleSessionResponse = (dispatch, body) => { if ( body.user && body.user.banned && - banWhitelistPaths.indexOf(window.location.pathname) === -1 + banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1) ) { window.location = '/accounts/banned-response/'; return;