Add repeated password for confirmation

This commit is contained in:
Ryan Prather 2024-12-10 22:51:51 -05:00
parent f3a32e9d94
commit 354d1fbde3

View File

@ -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,