mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 17:45:52 -05:00
Merge pull request #5357 from benjiwheeler/banned-page-list-2nd-try
update method of checking goodlist of pages for banned user to see (2nd try)
This commit is contained in:
commit
6cc59b9b9a
1 changed files with 6 additions and 5 deletions
|
@ -12,10 +12,11 @@ const Types = keyMirror({
|
||||||
SET_STATUS: null
|
SET_STATUS: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const banWhitelistPaths = [
|
const banGoodListPaths = [
|
||||||
'/accounts/banned-response/',
|
'/accounts/banned-response',
|
||||||
'/community_guidelines/',
|
'/community_guidelines',
|
||||||
'/community_guidelines'
|
'/privacy_policy',
|
||||||
|
'/terms_of_use'
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports.Status = keyMirror({
|
module.exports.Status = keyMirror({
|
||||||
|
@ -67,7 +68,7 @@ const handleSessionResponse = (dispatch, body) => {
|
||||||
if (
|
if (
|
||||||
body.user &&
|
body.user &&
|
||||||
body.user.banned &&
|
body.user.banned &&
|
||||||
banWhitelistPaths.indexOf(window.location.pathname) === -1
|
banGoodListPaths.every(goodPath => window.location.pathname.indexOf(goodPath) === -1)
|
||||||
) {
|
) {
|
||||||
window.location = '/accounts/banned-response/';
|
window.location = '/accounts/banned-response/';
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue