Commit 0905f0f7 authored by catch's avatar catch

Issue #2691025 by therealssj, ajalan065, Truptti, joyceg, yoroy, catch:...

Issue #2691025 by therealssj, ajalan065, Truptti, joyceg, yoroy, catch: Forgotten password message unnecessarily long
parent de0c60bc
......@@ -232,7 +232,7 @@ public function validateFinal(array &$form, FormStateInterface $form_state) {
// handlers that ran earlier than this one.
$user_input = $form_state->getUserInput();
$query = isset($user_input['name']) ? array('name' => $user_input['name']) : array();
$form_state->setErrorByName('name', $this->t('Unrecognized username or password. <a href=":password">Have you forgotten your password?</a>', array(':password' => $this->url('user.pass', [], array('query' => $query)))));
$form_state->setErrorByName('name', $this->t('Unrecognized username or password. <a href=":password">Forgot your password?</a>', array(':password' => $this->url('user.pass', [], array('query' => $query)))));
$accounts = $this->userStorage->loadByProperties(array('name' => $form_state->getValue('name')));
if (!empty($accounts)) {
$this->logger('user')->notice('Login attempt failed for %user.', array('%user' => $form_state->getValue('name')));
......
......@@ -171,7 +171,7 @@ function assertFailedLogin($account, $flood_trigger = NULL) {
}
}
else {
$this->assertText(t('Unrecognized username or password. Have you forgotten your password?'));
$this->assertText(t('Unrecognized username or password. Forgot your password?'));
}
}
}
......@@ -224,7 +224,7 @@ public function testUserResetPasswordTextboxFilled() {
'pass' => $this->randomMachineName(),
);
$this->drupalPostForm('user/login', $edit, t('Log in'));
$this->assertRaw(t('Unrecognized username or password. <a href=":password">Have you forgotten your password?</a>',
$this->assertRaw(t('Unrecognized username or password. <a href=":password">Forgot your password?</a>',
array(':password' => \Drupal::url('user.pass', [], array('query' => array('name' => $edit['name']))))));
unset($edit['pass']);
$this->drupalGet('user/password', array('query' => array('name' => $edit['name'])));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment