Skip to content
Snippets Groups Projects
Commit a4d254c6 authored by divyanshgupta002's avatar divyanshgupta002
Browse files

Issue#3513601: Improve password field.

parent 44ef2f05
No related branches found
No related tags found
1 merge request!11519Issue #3474692 by longwave, foxtrotcharlie, bbrala: Fix...
...@@ -70,7 +70,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form ...@@ -70,7 +70,7 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
public static function processPasswordConfirm(&$element, FormStateInterface $form_state, &$complete_form) { public static function processPasswordConfirm(&$element, FormStateInterface $form_state, &$complete_form) {
$element['pass1'] = [ $element['pass1'] = [
'#type' => 'password', '#type' => 'password',
'#title' => t('Password'), '#title' => t('New Password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'], '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],
'#required' => $element['#required'], '#required' => $element['#required'],
'#attributes' => [ '#attributes' => [
...@@ -81,7 +81,7 @@ public static function processPasswordConfirm(&$element, FormStateInterface $for ...@@ -81,7 +81,7 @@ public static function processPasswordConfirm(&$element, FormStateInterface $for
]; ];
$element['pass2'] = [ $element['pass2'] = [
'#type' => 'password', '#type' => 'password',
'#title' => t('Confirm password'), '#title' => t('Confirm New password'),
'#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'], '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],
'#required' => $element['#required'], '#required' => $element['#required'],
'#attributes' => [ '#attributes' => [
......
...@@ -129,6 +129,7 @@ public function form(array $form, FormStateInterface $form_state) { ...@@ -129,6 +129,7 @@ public function form(array $form, FormStateInterface $form_state) {
'#type' => 'password_confirm', '#type' => 'password_confirm',
'#size' => 25, '#size' => 25,
'#description' => $this->t('To change the current user password, enter the new password in both fields.'), '#description' => $this->t('To change the current user password, enter the new password in both fields.'),
'#weight' => -4,
]; ];
// To skip the current password field, the user must have logged in via a // To skip the current password field, the user must have logged in via a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment