@@ -655,7 +655,7 @@ First, create a controller for the login form:
655655
656656 class LoginController extends AbstractController
657657 {
658- #[Route('/login', name: 'login ')]
658+ #[Route('/login', name: 'app_login ')]
659659 public function index(): Response
660660 {
661661 return $this->render('login/index.html.twig', [
@@ -678,9 +678,9 @@ Then, enable the form login authenticator using the ``form_login`` setting:
678678 main :
679679 # ...
680680 form_login :
681- # "login " is the name of the route created previously
682- login_path : login
683- check_path : login
681+ # "app_login " is the name of the route created previously
682+ login_path : app_login
683+ check_path : app_login
684684
685685 .. code-block :: xml
686686
@@ -697,8 +697,8 @@ Then, enable the form login authenticator using the ``form_login`` setting:
697697 <config >
698698 <!-- ... -->
699699 <firewall name =" main" >
700- <!-- "login " is the name of the route created previously -->
701- <form-login login-path =" login " check-path =" login " />
700+ <!-- "app_login " is the name of the route created previously -->
701+ <form-login login-path =" app_login " check-path =" app_login " />
702702 </firewall >
703703 </config >
704704 </srv : container >
@@ -713,10 +713,10 @@ Then, enable the form login authenticator using the ``form_login`` setting:
713713
714714 $mainFirewall = $security->firewall('main');
715715
716- // "login " is the name of the route created previously
716+ // "app_login " is the name of the route created previously
717717 $mainFirewall->formLogin()
718- ->loginPath('login ')
719- ->checkPath('login ')
718+ ->loginPath('app_login ')
719+ ->checkPath('app_login ')
720720 ;
721721 };
722722
@@ -739,7 +739,7 @@ Edit the login controller to render the login form:
739739
740740 class LoginController extends AbstractController
741741 {
742- #[Route('/login', name: 'login ')]
742+ #[Route('/login', name: 'app_login ')]
743743 - public function index(): Response
744744 + public function index(AuthenticationUtils $authenticationUtils): Response
745745 {
@@ -777,7 +777,7 @@ Finally, create or update the template:
777777 <div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
778778 {% endif %}
779779
780- <form action="{{ path('login ') }}" method="post">
780+ <form action="{{ path('app_login ') }}" method="post">
781781 <label for="username">Email:</label>
782782 <input type="text" id="username" name="_username" value="{{ last_username }}"/>
783783
@@ -801,7 +801,7 @@ Finally, create or update the template:
801801
802802The form can look like anything, but it usually follows some conventions:
803803
804- * The ``<form> `` element sends a ``POST `` request to the ``login `` route, since
804+ * The ``<form> `` element sends a ``POST `` request to the ``app_login `` route, since
805805 that's what you configured as the ``check_path `` under the ``form_login `` key in
806806 ``security.yaml ``;
807807* The username (or whatever your user's "identifier" is, like an email) field has
@@ -914,7 +914,7 @@ be ``authenticate``:
914914 {# templates/login/index.html.twig #}
915915
916916 {# ... #}
917- <form action="{{ path('login ') }}" method="post">
917+ <form action="{{ path('app_login ') }}" method="post">
918918 {# ... the login fields #}
919919
920920 <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
0 commit comments