8000 Update form_login_setup.rst · symfony/symfony-docs@5b0a583 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b0a583

Browse files
JakubSzczesniakjaviereguiluz
authored andcommitted
Update form_login_setup.rst
1 parent 2309998 commit 5b0a583

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

security/form_login_setup.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ a traditional HTML form that submits to ``/login``:
191191
class LoginFormAuthenticator extends AbstractFormLoginAuthenticator implements PasswordAuthenticatedInterface
192192
{
193193
use TargetPathTrait;
194+
195+
public const LOGIN_ROUTE = 'app_login';
194196

195197
private $entityManager;
196198
private $urlGenerator;
@@ -207,7 +209,7 @@ a traditional HTML form that submits to ``/login``:
207209

208210
public function supports(Request $request)
209211
{
210-
return 'app_login' === $request->attributes->get('_route')
212+
return self::LOGIN_ROUTE === $request->attributes->get('_route')
211213
&& $request->isMethod('POST');
212214
}
213215

@@ -260,7 +262,7 @@ a traditional HTML form that submits to ``/login``:
260262

261263
protected function getLoginUrl()
262264
{
263-
return $this->urlGenerator->generate('app_login');
265+
return $this->urlGenerator->generate(self::LOGIN_ROUTE);
264266
}
265267
}
266268

0 commit comments

Comments
 (0)
0