Skip to content

Commit 67432f0

Browse files
committed
Merge pull request #2256 from WouterJ/security_paths
Used route names for security paths
2 parents 47aeb95 + 4dabbf2 commit 67432f0

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

cookbook/security/form_login.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Changing the Default Page
4343
~~~~~~~~~~~~~~~~~~~~~~~~~
4444

4545
First, the default page can be set (i.e. the page the user is redirected to
46-
if no previous page was stored in the session). To set it to ``/admin`` use
47-
the following config:
46+
if no previous page was stored in the session). To set it to the
47+
``default_security_target`` route use the following config:
4848

4949
.. configuration-block::
5050

@@ -56,15 +56,15 @@ the following config:
5656
main:
5757
form_login:
5858
# ...
59-
default_target_path: /admin
59+
default_target_path: default_security_target
6060
6161
.. code-block:: xml
6262
6363
<!-- app/config/security.xml -->
6464
<config>
6565
<firewall>
6666
<form-login
67-
default_target_path="/admin"
67+
default_target_path="default_security_target"
6868
/>
6969
</firewall>
7070
</config>
@@ -79,13 +79,14 @@ the following config:
7979
8080
'form_login' => array(
8181
// ...
82-
'default_target_path' => '/admin',
82+
'default_target_path' => 'default_security_target',
8383
),
8484
),
8585
),
8686
));
8787
88-
Now, when no URL is set in the session, users will be sent to ``/admin``.
88+
Now, when no URL is set in the session, users will be sent to the
89+
``default_security_target`` route.
8990

9091
Always Redirect to the Default Page
9192
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -276,8 +277,8 @@ Redirecting on Login Failure
276277
In addition to redirecting the user after a successful login, you can also set
277278
the URL that the user should be redirected to after a failed login (e.g. an
278279
invalid username or password was submitted). By default, the user is redirected
279-
back to the login form itself. You can set this to a different URL with the
280-
following config:
280+
back to the login form itself. You can set this to a different route (e.g.
281+
``login_failure``) with the following config:
281282

282283
.. configuration-block::
283284

@@ -289,7 +290,7 @@ following config:
289290
main:
290291
form_login:
291292
# ...
292-
failure_path: /login_failure
293+
failure_path: login_failure
293294
294295
.. code-block:: xml
295296
@@ -312,7 +313,7 @@ following config:
312313
313314
'form_login' => array(
314315
// ...
315-
'failure_path' => login_failure,
316+
'failure_path' => 'login_failure',
316317
),
317318
),
318319
),

0 commit comments

Comments
 (0)