mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 05:43:16 +08:00
FIX: when rate limited on login attempts, show a meaningful message instead of unknown error.
This commit is contained in:
parent
cc2a33617f
commit
249ef75f12
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
|
@ -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..."
|
||||
|
|
Loading…
Reference in New Issue
Block a user