def _handle_failed_authentication(self, user): """ Handles updating the failed login count, inactive user notifications, and logging failed authentications. """ if user and LoginFailures.is_feature_enabled(): LoginFailures.increment_lockout_counter(user) raise AuthFailedError(_('Email or password is incorrect.'))
def _check_excessive_login_attempts(self, user): """ See if account has been locked out due to excessive login failures """ if user and LoginFailures.is_feature_enabled(): if LoginFailures.is_user_locked_out(user): raise AuthFailedError(_('This account has been temporarily locked due ' 'to excessive login failures. Try again later.'))