Stop spinner and display XHR errors if they occur

Resolves GH-232
This commit is contained in:
Ray Schamp 2015-11-12 12:49:40 -05:00
parent c15b6a9681
commit 7ed45cb5dd

View file

@ -126,12 +126,14 @@ var Navigation = React.createClass({
json: formData,
useCsrf: true
}, function (err, body) {
if (err) this.setState({'loginError': err.message});
if (body) {
body = body[0];
if (!body.success) {
if (body.redirect) {
window.location = body.redirect;
}
// Update login error message to a friendlier one if it exists
this.setState({'loginError': body.msg});
} else {
this.closeLogin();
@ -142,8 +144,9 @@ var Navigation = React.createClass({
}.bind(this));
window.refreshSession();
}
callback();
}
// JS error already logged by api mixin
callback();
}.bind(this));
},
handleLogOut: function (e) {