Unverified Commit 7403764a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3091284 by shaal, joum, kostask: Prevent autofilling passwords for new users

parent 85fa773d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -73,7 +73,10 @@ public static function processPasswordConfirm(&$element, FormStateInterface $for
      '#title' => t('Password'),
      '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],
      '#required' => $element['#required'],
      '#attributes' => ['class' => ['password-field', 'js-password-field']],
      '#attributes' => [
        'class' => ['password-field', 'js-password-field'],
        'autocomplete' => ['new-password'],
      ],
      '#error_no_message' => TRUE,
    ];
    $element['pass2'] = [
@@ -81,7 +84,10 @@ public static function processPasswordConfirm(&$element, FormStateInterface $for
      '#title' => t('Confirm password'),
      '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],
      '#required' => $element['#required'],
      '#attributes' => ['class' => ['password-confirm', 'js-password-confirm']],
      '#attributes' => [
        'class' => ['password-confirm', 'js-password-confirm'],
        'autocomplete' => ['new-password'],
      ],
      '#error_no_message' => TRUE,
    ];
    $element['#element_validate'] = [[get_called_class(), 'validatePasswordConfirm']];