@@ -221,11 +221,9 @@ this by setting ``use_referer`` to true (it defaults to false):
221
221
Redirecting on Login Failure
222
222
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223
223
224
- In addition to redirecting the user after a successful login, you can also set
225
- the URL that the user should be redirected to after a failed login (e.g. an
226
- invalid username or password was submitted). By default, the user is redirected
227
- back to the login form itself. You can set this to a different route (e.g.
228
- ``login_failure ``) with the following config:
224
+ After a failed login (e.g. an invalid username or password was submitted), the
225
+ user is redirected back to the login form itself. Use the ``failure_path ``
226
+ option to define the route or URL the user is redirected to:
229
227
230
228
.. configuration-block ::
231
229
@@ -283,9 +281,8 @@ Control the Redirect URL from inside the Form
283
281
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284
282
285
283
You can also override where the user is redirected to via the form itself by
286
- including a hidden field with the name ``_target_path `` for success and
287
- ``_failure_path `` for failure. For example, to redirect to the URL defined
288
- by some ``account `` route, use the following:
284
+ including a hidden field with the name ``_target_path `` for successful logins
285
+ and ``_failure_path `` for login errors:
289
286
290
287
.. configuration-block ::
291
288
@@ -331,9 +328,8 @@ by some ``account`` route, use the following:
331
328
332
329
Now, the user will be redirected to the value of the hidden form field. The
333
330
value attribute can be a relative path, absolute URL, or a route name.
334
- You can even change the name of the hidden form field by changing the
335
- ``target_path_parameter `` and ``failure_path_parameter `` options to another
336
- value.
331
+ The name of the hidden fields in the login form is also configurable using the
332
+ ``target_path_parameter `` and ``failure_path_parameter `` options of the firewall.
337
333
338
334
.. configuration-block ::
339
335
0 commit comments