FIX: when rate limited on login attempts, show a meaningful message instead of unknown error.

This commit is contained in:
Neil Lalonde
2015-07-14 18:17:39 -04:00
parent cc2a33617f
commit 249ef75f12
2 changed files with 7 additions and 2 deletions

View File

@@ -93,9 +93,13 @@ export default DiscourseController.extend(ModalFunctionality, {
$hidden_login_form.submit();
}
}, function() {
}, function(e) {
// Failed to login
self.flash(I18n.t('login.error'), 'error');
if (e.jqXHR && e.jqXHR.status === 429) {
self.flash(I18n.t('login.rate_limit'), 'error');
} else {
self.flash(I18n.t('login.error'), 'error');
}
self.set('loggingIn', false);
});