mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
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:
parent
3105edc3b6
commit
ad7be2dad8
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue