<?php
namespace App\Form;
use App\Entity\User;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Karser\Recaptcha3Bundle\Form\Recaptcha3Type;
use Karser\Recaptcha3Bundle\Validator\Constraints\Recaptcha3;
class ForgottenPassType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->setAction("#");
$builder
->add('emailVerif', EmailType::class, [
'required' => true,
'label' => 'Email'
])
->add('captcha', Recaptcha3Type::class, [
'constraints' => new Recaptcha3(),
'action_name' => 'homepage',
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// 'data_class' => User::class,
// enable/disable CSRF protection for this form
//'csrf_protection' => false,
// the name of the hidden HTML field that stores the token
'csrf_field_name' => '_token',
// an arbitrary string used to generate the value of the token
// using a different string for each form improves its security
'csrf_token_id' => 'task_item',
]);
}
}