@@ -20,9 +20,8 @@ my password, etc.)
20
20
Using the Login Link Authenticator
21
21
----------------------------------
22
22
23
- This guide assumes you have setup security and have created a user object
24
- in your application. Follow :doc: `the main security guide </security >` if
25
- this is not yet the case.
23
+ This guide assumes you have :doc: `setup security and have created a user object </security >`
24
+ in your application.
26
25
27
26
1) Configure the Login Link Authenticator
28
27
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -160,9 +159,8 @@ intercept requests to this route:
160
159
2) Generate the Login Link
161
160
~~~~~~~~~~~~~~~~~~~~~~~~~~
162
161
163
- Now that the authenticator is able to check the login links, you must
164
- create a page where a user can request a login link and log in to your
165
- website.
162
+ Now that the authenticator is able to check the login links, you can
163
+ create a page where a user can request a login link.
166
164
167
165
The login link can be generated using the
168
166
:class: `Symfony\\ Component\\ Security\\ Http\\ LoginLink\\ LoginLinkHandlerInterface `.
@@ -185,7 +183,7 @@ this interface::
185
183
*/
186
184
public function requestLoginLink(LoginLinkHandlerInterface $loginLinkHandler, UserRepository $userRepository, Request $request)
187
185
{
188
- // check if login form is submitted
186
+ // check if form is submitted
189
187
if ($request->isMethod('POST')) {
190
188
// load the user in some way (e.g. using the form input)
191
189
$email = $request->request->get('email');
@@ -199,16 +197,16 @@ this interface::
199
197
// ... send the link and return a response (see next section)
200
198
}
201
199
202
- // if it's not submitted, render the "login " form
203
- return $this->render('security/login .html.twig');
200
+ // if it's not submitted, render the "request " form
201
+ return $this->render('security/request_login_link .html.twig');
204
202
}
205
203
206
204
// ...
207
205
}
208
206
209
207
.. code-block :: html+twig
210
208
211
- {# templates/security/login .html.twig #}
209
+ {# templates/security/request_login_link .html.twig #}
212
210
{% extends 'base.html.twig' %}
213
211
214
212
{% block body %}
@@ -824,7 +822,7 @@ features such as the locale used to generate the link::
824
822
// ...
825
823
}
826
824
827
- return $this->render('security/login .html.twig');
825
+ return $this->render('security/request_login_link .html.twig');
828
826
}
829
827
830
828
// ...
0 commit comments