Use of $form_state->setErrorByName() within email_registration_user_login_validate prevents other core errors

Created on 26 April 2021, over 3 years ago
Updated 10 October 2023, 12 months ago

Problem/Motivation

Use of $form_state->setErrorByName() within email_registration_user_login_validate can prevent other core errors, such as the this one from the UserLoginForm.php

 $form_state->setErrorByName('name', $this->t('Too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or <a href=":url">request a new password</a>.', [':url' => Url::fromRoute('user.pass')->toString()]));

There is a related Drupal core issue πŸ› FormState::setErrorByName does not set multiple errors on the same element Needs work

Steps to reproduce

  1. Install this module and do not enable the "Allow log in with email address or username" option
  2. Create a flood events for blocking IP address; 50 failed login attempts in one hour using a non-existing username or different usernames
  3. 51st failed login attempt, observe "Unrecognized email address or password. Forgot your password?" error message

Expected to see "Too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or request a new password.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

πŸ› Bug report
Status

Postponed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jasonawant New Orleans, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024