Gregwar / CaptchaBundle

Symfony bundle implementing a "captcha" form type
MIT License
345 stars 127 forks source link

Why is the captcha skipping invalid code? #221

Open StasToken opened 3 years ago

StasToken commented 3 years ago

gregwar/captcha-bundle: ^2.1 Symfony 5.2.2 I installed the captcha and configured it as described in the instructions for my standard login form

namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Gregwar\CaptchaBundle\Type\CaptchaType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;

class LoginType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('email',null,array('label' => false,'attr' => ['class' => 'register-form-input','autocomplete' => 'off']));
        $builder->add('password',PasswordType::class,array('label' => false,'attr' => ['class' => 'register-form-input','autocomplete' => 'off']));
        $builder->add('captcha', CaptchaType::class,array('label' => false,'attr' => ['class' => 'register-form-input','autocomplete' => 'off']));
    }
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            // Configure your form options here
        ]);
    }
}

The form is shown, but the validation is always successful even if I enter a code that does not match the picture WTF? - Should I check it myself with my hands? but then how should I do it? Or I somehow misunderstood the purpose of this package - can you get a comment on this issue?