I have a project that started some time ago with Symfony 4. And I had login files generated from the php bin/console make:authcommand. Today I saw that the file information have changed a bit in the newer document so I wanted to update mine. I ran the same command again, renamed the new controller and authentication file. But when I tried it out, I got this error:
Cannot autowire service "App\Security\LoginFormAuthenticator": argument "$csrfTokenManager" of method "__construct()" references interface "Symfony\Component\Security\Csrf\CsrfTokenManagerInterface" but no such service exists. Did you create a class that implements this interface?
What does it mean?
I had the same issue. You must enable the csrf protection in config/packages/framework.yaml:
framework:
secret: '%env(APP_SECRET)%'
csrf_protection: false #change this to true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With