From 354d1fbde3148cb9ab2ce8f32d5e6e55ac8b645b Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 10 Dec 2024 22:51:51 -0500 Subject: [PATCH] Add repeated password for confirmation --- src/Form/RegistrationFormType.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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,