@@ -296,8 +296,8 @@ First, enable form login under your firewall:
296
296
pattern : ^/
297
297
anonymous : ~
298
298
form_login :
299
- login_path : / login
300
- check_path : / login_check
299
+ login_path : login
300
+ check_path : login_check
301
301
302
302
.. code-block :: xml
303
303
@@ -313,7 +313,7 @@ First, enable form login under your firewall:
313
313
<config >
314
314
<firewall name =" secured_area" pattern =" ^/" >
315
315
<anonymous />
316
- <form-login login_path =" / login" check_path =" / login_check" />
316
+ <form-login login_path =" login" check_path =" login_check" />
317
317
</firewall >
318
318
</config >
319
319
</srv : container >
@@ -327,8 +327,8 @@ First, enable form login under your firewall:
327
327
'pattern' => '^/',
328
328
'anonymous' => array(),
329
329
'form_login' => array(
330
- 'login_path' => '/ login',
331
- 'check_path' => '/ login_check',
330
+ 'login_path' => 'login',
331
+ 'check_path' => 'login_check',
332
332
),
333
333
),
334
334
),
@@ -355,10 +355,11 @@ First, enable form login under your firewall:
355
355
'form_login' => array(),
356
356
357
357
Now, when the security system initiates the authentication process, it will
358
- redirect the user to the login form (``/login `` by default). Implementing
359
- this login form visually is your job. First, create two routes: one that
360
- will display the login form (i.e. ``/login ``) and one that will handle the
361
- login form submission (i.e. ``/login_check ``):
358
+ redirect the user to the login form (``/login `` by default). Implementing this
359
+ login form visually is your job. First, the create two routes we used in the
360
+ security configuration: the ``login `` route will display the login form (i.e.
361
+ ``/login ``) and the ``login_check `` route will handle the login form
362
+ submission (i.e. ``/login_check ``):
362
363
363
364
.. configuration-block ::
364
365
@@ -408,12 +409,11 @@ login form submission (i.e. ``/login_check``):
408
409
to this URL.
409
410
410
411
.. versionadded :: 2.1
411
- As of Symfony 2.1, you *must * have routes configured for your ``login_path ``
412
- (e.g. `` /login ``), ``check_path `` (e.g. `` /login_check ``) and `` logout ``
413
- (e.g. `` /logout `` - see ` Logging Out `_) URLs .
412
+ As of Symfony 2.1, you *must * have routes configured for your ``login_path ``,
413
+ `` check_path `` ``logout `` keys. These keys can be route names (as shown
414
+ in this example) or URLs that have routes configured for them .
414
415
415
- Notice that the name of the ``login `` route isn't important. What's important
416
- is that the URL of the route (``/login ``) matches the ``login_path `` config
416
+ Notice that the name of the ``login `` route matches the``login_path`` config
417
417
value, as that's where the security system will redirect users that need
418
418
to login.
419
419
@@ -557,7 +557,7 @@ see :doc:`/cookbook/security/form_login`.
557
557
558
558
**1. Create the correct routes **
559
559
560
- First, be sure that you've defined the ``/ login `` and ``/ login_check ``
560
+ First, be sure that you've defined the ``login `` and ``login_check ``
561
561
routes correctly and that they correspond to the ``login_path `` and
562
562
``check_path `` config values. A misconfiguration here can mean that you're
563
563
redirected to a 404 page instead of the login page, or that submitting
@@ -1671,7 +1671,7 @@ the firewall can handle this automatically for you when you activate the
1671
1671
'firewalls' => array(
1672
1672
'secured_area' => array(
1673
1673
// ...
1674
- 'logout' => array('path' => 'logout', 'target' => '/'),
1674
+ 'logout' => array('path' => '/ logout', 'target' => '/'),
1675
1675
),
1676
1676
),
1677
1677
// ...
0 commit comments