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);
});

View File

@ -718,6 +718,7 @@ en:
email_placeholder: "email or username"
caps_lock_warning: "Caps Lock is on"
error: "Unknown error"
rate_limit: "Please wait before trying to log in again."
blank_username_or_password: "Please enter your email or username, and password."
reset_password: 'Reset Password'
logging_in: "Signing In..."