diff --git a/cookbook/security/form_login_setup.rst b/cookbook/security/form_login_setup.rst
index 011ab6f6894..cfed1d88679 100644
--- a/cookbook/security/form_login_setup.rst
+++ b/cookbook/security/form_login_setup.rst
@@ -76,20 +76,15 @@ First, enable form login under your firewall:
Now, when the security system initiates the authentication process, it will
redirect the user to the login form ``/login``. Implementing this login form
visually is your job. First, create a new ``SecurityController`` inside a
-bundle with an empty ``loginAction``::
+bundle::
// src/AppBundle/Controller/SecurityController.php
namespace AppBundle\Controller;
- use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class SecurityController extends Controller
{
- public function loginAction(Request $request)
- {
- // todo...
- }
}
Next, create two routes: one for each of the paths your configured earlier
@@ -100,7 +95,9 @@ under your ``form_login`` configuration (``/login`` and ``/login_check``):
.. code-block:: php-annotations
// src/AppBundle/Controller/SecurityController.php
+
// ...
+ use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class SecurityController extends Controller
@@ -110,7 +107,6 @@ under your ``form_login`` configuration (``/login`` and ``/login_check``):
*/
public function loginAction(Request $request)
{
- // todo ...
}
/**
@@ -118,6 +114,8 @@ under your ``form_login`` configuration (``/login`` and ``/login_check``):
*/
public function loginCheckAction()
{
+ // this controller will not be executed,
+ // as the route is handled by the Security system
}
}
@@ -129,6 +127,8 @@ under your ``form_login`` configuration (``/login`` and ``/login_check``):
defaults: { _controller: AppBundle:Security:login }
login_check:
path: /login_check
+ # no controller is bound to this route
+ # as it's handled by the Security system
.. code-block:: xml
@@ -144,6 +144,8 @@ under your ``form_login`` configuration (``/login`` and ``/login_check``):
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: