mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
log error for session request if there
And only try to update the session if a body is present
This commit is contained in:
parent
f88984f254
commit
1382fc48f6
1 changed files with 8 additions and 4 deletions
|
@ -37,11 +37,15 @@ var translations = require('../locales/translations.json');
|
||||||
host: '',
|
host: '',
|
||||||
uri: '/session/'
|
uri: '/session/'
|
||||||
}, function (err, body) {
|
}, function (err, body) {
|
||||||
|
if (err) return;
|
||||||
|
|
||||||
|
if (typeof body !== 'undefined') {
|
||||||
if (body.banned) {
|
if (body.banned) {
|
||||||
return window.location = body.redirectUrl;
|
return window.location = body.redirectUrl;
|
||||||
} else {
|
} else {
|
||||||
window.updateSession(body);
|
window.updateSession(body);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue