@@ -13,9 +13,8 @@ my password, etc.)
13
13
Using the Login Link Authenticator
14
14
----------------------------------
15
15
16
- This guide assumes you have setup security and have created a user object
17
- in your application. Follow :doc: `the main security guide </security >` if
18
- this is not yet the case.
16
+ This guide assumes you have :doc: `setup security and have created a user object </security >`
17
+ in your application.
19
18
20
19
1) Configure the Login Link Authenticator
21
20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -134,9 +133,8 @@ intercept requests to this route:
134
133
2) Generate the Login Link
135
134
~~~~~~~~~~~~~~~~~~~~~~~~~~
136
135
137
- Now that the authenticator is able to check the login links, you must
138
- create a page where a user can request a login link and log in to your
139
- website.
136
+ Now that the authenticator is able to check the login links, you can
137
+ create a page where a user can request a login link.
140
138
141
139
The login link can be generated using the
142
140
:class: `Symfony\\ Component\\ Security\\ Http\\ LoginLink\\ LoginLinkHandlerInterface `.
@@ -158,7 +156,7 @@ this interface::
158
156
#[Route('/login', name: 'login')]
159
157
public function requestLoginLink(LoginLinkHandlerInterface $loginLinkHandler, UserRepository $userRepository, Request $request): Response
160
158
{
161
- // check if login form is submitted
159
+ // check if form is submitted
162
160
if ($request->isMethod('POST')) {
163
161
// load the user in some way (e.g. using the form input)
164
162
$email = $request->request->get('email');
@@ -172,16 +170,16 @@ this interface::
172
170
// ... send the link and return a response (see next section)
173
171
}
174
172
175
- // if it's not submitted, render the "login" form
176
- return $this->render('security/login .html.twig');
173
+ // if it's not submitted, render the form to request the "login link"
174
+ return $this->render('security/request_login_link .html.twig');
177
175
}
178
176
179
177
// ...
180
178
}
181
179
182
180
.. code-block :: html+twig
183
181
184
- {# templates/security/login .html.twig #}
182
+ {# templates/security/request_login_link .html.twig #}
185
183
{% extends 'base.html.twig' %}
186
184
187
185
{% block body %}
@@ -793,7 +791,7 @@ features such as the locale used to generate the link::
793
791
// ...
794
792
}
795
793
796
- return $this->render('security/login .html.twig');
794
+ return $this->render('security/request_login_link .html.twig');
797
795
}
798
796
799
797
// ...
0 commit comments