diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index e40bcb1..bda48af 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -5,6 +5,7 @@ namespace App\Form; use App\Entity\User; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; +use Symfony\Component\Form\Extension\Core\Type\RepeatedType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\Length; @@ -18,7 +19,10 @@ class RegistrationFormType extends AbstractType ->add('name') ->add('username') ->add('email') - ->add('plainPassword', PasswordType::class, [ + ->add('plainPassword', RepeatedType::class, [ + 'type' => PasswordType::class, + 'first_options' => ['label' => 'Password'], + 'second_options' => ['label' => 'Repeat Password'], // instead of being set onto the object directly, // this is read and encoded in the controller 'mapped' => false,