@@ -24,9 +24,8 @@ my password, etc.)
24
24
Using the Login Link Authenticator
25
25
----------------------------------
26
26
27
- This guide assumes you have setup security and have created a user object
28
- in your application. Follow :doc: `the main security guide </security >` if
29
- this is not yet the case.
27
+ This guide assumes you have :doc: `setup security and have created a user object </security >`
28
+ in your application.
30
29
31
30
1) Configure the Login Link Authenticator
32
31
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -164,9 +163,8 @@ intercept requests to this route:
164
163
2) Generate the Login Link
165
164
~~~~~~~~~~~~~~~~~~~~~~~~~~
166
165
167
- Now that the authenticator is able to check the login links, you must
168
- create a page where a user can request a login link and log in to your
169
- website.
166
+ Now that the authenticator is able to check the login links, you can
167
+ create a page where a user can request a login link.
170
168
171
169
The login link can be generated using the
172
170
:class: `Symfony\\ Component\\ Security\\ Http\\ LoginLink\\ LoginLinkHandlerInterface `.
@@ -189,7 +187,7 @@ this interface::
189
187
*/
190
188
public function requestLoginLink(LoginLinkHandlerInterface $loginLinkHandler, UserRepository $userRepository, Request $request)
191
189
{
192
- // check if login form is submitted
190
+ // check if form is submitted
193
191
if ($request->isMethod('POST')) {
194
192
// load the user in some way (e.g. using the form input)
195
193
$email = $request->request->get('email');
@@ -203,16 +201,16 @@ this interface::
203
201
// ... send the link and return a response (see next section)
204
202
}
205
203
206
- // if it's not submitted, render the "login " form
207
- return $this->render('security/login .html.twig');
204
+ // if it's not submitted, render the "request " form
205
+ return $this->render('security/request_login_link .html.twig');
208
206
}
209
207
210
208
// ...
211
209
}
212
210
213
211
.. code-block :: html+twig
214
212
215
- {# templates/security/login .html.twig #}
213
+ {# templates/security/request_login_link .html.twig #}
216
214
{% extends 'base.html.twig' %}
217
215
218
216
{% block body %}
@@ -802,7 +800,7 @@ features such as the locale used to generate the link::
802
800
// ...
803
801
}
804
802
805
- return $this->render('security/login .html.twig');
803
+ return $this->render('security/request_login_link .html.twig');
806
804
}
807
805
808
806
// ...
0 commit comments