Issue #3198010 by mcdruid, acbramley, mstrelan, quietone, manojithape,...
Issue #3198010 by mcdruid, acbramley, mstrelan, quietone, manojithape, vikashsoni, chetanbharambe, sarguna raj M, larowlan, alexpott: User login page broken when there are more than 5 failed login attempts for an account
@trigger_error('Passing the flood service to '.__METHOD__.' is deprecated in drupal:9.1.0 and is replaced by user.flood_control in drupal:10.0.0. See https://www.drupal.org/node/3067148',E_USER_DEPRECATED);
@@ -237,7 +248,9 @@ public function validateFinal(array &$form, FormStateInterface $form_state) {
// We did not find a uid, so the limit is IP-based.
$message=$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()]);
@@ -217,6 +217,7 @@ public function assertFailedLogin(User $account, string $flood_trigger = NULL):
->fetchField();
if($flood_trigger=='user'){
$this->assertSession()->pageTextMatches("/There (has|have) been more than \w+ failed login attempt.* for this account. It is temporarily blocked. Try again later or request a new password./");
$this->assertEquals('Flood control blocked login attempt for uid %uid from %ip',$last_log,'A watchdog message was logged for the login attempt blocked by flood control per user.');
@@ -224,6 +225,7 @@ public function assertFailedLogin(User $account, string $flood_trigger = NULL):
else{
// No uid, so the limit is IP-based.
$this->assertSession()->pageTextContains("Too many failed login attempts from your IP address. This IP address is temporarily blocked. Try again later or request a new password.");
$this->assertEquals('Flood control blocked login attempt from %ip',$last_log,'A watchdog message was logged for the login attempt blocked by flood control per IP.');