title: All forms redirect to login page - Symfony
body: <p>I have a little problem with forms. All forms after pressing submit button redirect the user to login page. No matter what url I put in the form it gets redirected to Login Page.</p>
  <p>Here is my registration code:</p>
  <pre><code>&lt;?php
  
  namespace App\Controller;
  
  use App\Entity\Account\Account;
  use App\Form\RegistrationFormType;
  use App\Security\EmailVerifier;
  use App\Security\LoginFormAuthenticator;
  use Symfony\Bridge\Twig\Mime\TemplatedEmail;
  use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\Mime\Address;
  use Symfony\Component\Routing\Annotation\Route;
  use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
  use Symfony\Component\Security\Guard\GuardAuthenticatorHandler;
  
  
  class RegistrationController extends AbstractController
  {
  
      /**
       * @Route(&quot;/register&quot;, name=&quot;app_register&quot;)
       */
      public function register(Request $request)
      {
          return $this-&gt;render('registration/register.html.twig', [
              
          ]);
      }
  }
  </code></pre>
  <p>And template:</p>
  <pre><code>{% extends 'base.html.twig' %}
  
  {% block body_id 'login' %}
  
  {% block stylesheets %}
      {{ encore_entry_link_tags('app') }}
      {{ encore_entry_link_tags('register') }}
  {% endblock %}
  
  {% block body %}
  &lt;section class=&quot;container mt-3 text-white&quot;&gt;
      &lt;div class=&quot;post&quot;&gt;
          &lt;h2&gt;Register&lt;/h2&gt;
          
          &lt;form action='{{ path('app_register') }}' class='form' method=&quot;POST&quot;&gt;
              &lt;p class='field required'&gt;
                  &lt;label class='label required' for='name'&gt;{{ 'label.username'|trans }}&lt;/label&gt;
                  &lt;input class='text-input' type=&quot;text&quot; id=&quot;username&quot; name=&quot;username&quot; class=&quot;form-control&quot;/&gt;
              &lt;/p&gt;
              &lt;p class='field required'&gt;
                  &lt;label class='label required' for='email'&gt;Email&lt;/label&gt;
                  &lt;input class='text-input' type=&quot;email&quot; id=&quot;email&quot; name=&quot;email&quot; class=&quot;form-control&quot; /&gt;                
              &lt;/p&gt;
              &lt;p class='field required'&gt;
                  &lt;label class='label required' for='password'&gt;{{ 'label.password'|trans }}&lt;/label&gt;
                  &lt;input class='text-input' type=&quot;password&quot; id=&quot;password&quot; name=&quot;password&quot; class=&quot;form-control&quot; /&gt;                
              &lt;/p&gt;    
              &lt;p class='field'&gt;
                  &lt;input class='button' type='submit' value='Register'&gt;
              &lt;/p&gt;
          &lt;/form&gt;
      &lt;/div&gt;
      &lt;!-- --&gt;
  &lt;/div&gt;
  &lt;/section&gt;
  
  {% endblock %}
  </code></pre>
  <p>Do you know about any reason for it to happen? It happens with every form in the project. Even if I use form builder. All submit buttons redirect you to login page. Hope you can help.</p>