Skip to content

Commit 24ccff7

Browse files
committed
[security] make:security:form-login is now available in MakerBundle
1 parent e8391c0 commit 24ccff7

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

security.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,33 @@ Most websites have a login form where users authenticate using an
662662
identifier (e.g. email address or username) and a password. This
663663
functionality is provided by the *form login authenticator*.
664664

665-
First, create a controller for the login form:
665+
`MakerBundle` has a new ``make:security:form-login`` command that was introduced
666+
in ``v1.x.x`` that will generate the controller, twig template, and configure
667+
``security.yaml`` after answering a couple of questions:
668+
669+
.. code-block:: terminal
670+
671+
$ php bin/console make:security:form-login
672+
673+
Choose a name for the controller class (e.g. SecurityController) [SecurityController]:
674+
> SecurityController
675+
676+
Do you want to generate a '/logout' URL? (yes/no) [yes]:
677+
> y
678+
679+
created: src/Controller/SecurityController.php
680+
created: templates/security/login.html.twig
681+
updated: config/packages/security.yaml
682+
683+
684+
Success!
685+
686+
687+
Next: Review and adapt the login template: ssecurity/login.html.twig to suite your needs.
688+
689+
WooHoo! You're all set to start authenticating users.
690+
691+
If you prefer to do this manually, first, create a controller for the login form:
666692

667693
.. code-block:: terminal
668694

0 commit comments

Comments
 (0)