Redirect to ban appeal if the user is banned

The default behavior is for the `/session/` request to be redirected to the ban appeal page. Unfortunately we can't detect this 302 response, as the browser transparently handles it and javascript just sees a 200 response with a weird body.  So I've updated scratchr2 to return a special response for banned `/session/` requests.
This commit is contained in:
Ray Schamp 2015-10-20 16:17:53 -04:00
parent 3105edc3b6
commit ad7be2dad8

View file

@ -34,7 +34,11 @@ require('custom-event-polyfill');
host: '',
uri: '/session/'
}, function (err, body) {
window.updateSession(body);
if (body.banned) {
return window.location = body.redirectUrl;
} else {
window.updateSession(body);
}
});
};