mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-03-26 12:50:44 -04:00
Merge pull request #314 from mewtaylor/issue/gh-251-ban-undefined
Fix GH-251: log error for session request if there
This commit is contained in:
commit
4ab7cfef6b
1 changed files with 8 additions and 4 deletions
12
src/init.js
12
src/init.js
|
@ -37,10 +37,14 @@ var translations = require('../locales/translations.json');
|
||||||
host: '',
|
host: '',
|
||||||
uri: '/session/'
|
uri: '/session/'
|
||||||
}, function (err, body) {
|
}, function (err, body) {
|
||||||
if (body.banned) {
|
if (err) return;
|
||||||
return window.location = body.redirectUrl;
|
|
||||||
} else {
|
if (typeof body !== 'undefined') {
|
||||||
window.updateSession(body);
|
if (body.banned) {
|
||||||
|
return window.location = body.redirectUrl;
|
||||||
|
} else {
|
||||||
|
window.updateSession(body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue