Merge pull request #951 from mewtaylor/issue/ban-whitelist

Don’t redirect banned user on community guidelines
This commit is contained in:
Matthew Taylor 2016-10-18 16:35:08 -04:00 committed by GitHub
commit f8a6d975c7

View file

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