mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Merge pull request #951 from mewtaylor/issue/ban-whitelist
Don’t redirect banned user on community guidelines
This commit is contained in:
commit
f8a6d975c7
1 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,11 @@ var Types = keyMirror({
|
|||
SET_STATUS: null
|
||||
});
|
||||
|
||||
const BAN_WHITELIST_PATHS = [
|
||||
'/accounts/banned-response/',
|
||||
'/community_guidelines/'
|
||||
];
|
||||
|
||||
module.exports.Status = keyMirror({
|
||||
FETCHED: null,
|
||||
NOT_FETCHED: null,
|
||||
|
@ -71,7 +76,7 @@ module.exports.refreshSession = function () {
|
|||
if (
|
||||
body.user &&
|
||||
body.user.banned &&
|
||||
window.location.pathname !== '/accounts/banned-response/') {
|
||||
BAN_WHITELIST_PATHS.indexOf(window.location.pathname) === -1) {
|
||||
return window.location = '/accounts/banned-response/';
|
||||
} else if (
|
||||
body.flags &&
|
||||
|
|
Loading…
Reference in a new issue