Skip to content

Commit 10daf0a

Browse files
committed
minor #17481 [Security] WIP - make:security:form-login is now available in MakerBundle (jrushlow)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Security] WIP - make:security:form-login is now available in MakerBundle MakerBundle is going to introduce a new command to generate and configure the files needed for `FormLogin` in SecurityBundle. Not sure if we should completely remove the "manual" howto in the docs or go with something like I have here. Note: Command name and output subject to change until we merge, I'll update this PR accordingly. In the meantime, feedback welcomed! Note: Additional `make:security:*` commands to follow shortly. ## Blockers: - [x] Merge symfony/maker-bundle#1244 - [ ] Release MakerBundle `1.49.0` Commits ------- a6b2fd0 [Security] WIP - make:security:form-login is now available in MakerBundle
2 parents 979eee7 + a6b2fd0 commit 10daf0a

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

security.rst

+27-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,33 @@ Most websites have a login form where users authenticate using an
650650
identifier (e.g. email address or username) and a password. This
651651
functionality is provided by the built-in :class:`Symfony\\Component\\Security\\Http\Authenticator\\FormLoginAuthenticator`.
652652

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

655681
.. code-block:: terminal
656682

0 commit comments

Comments
 (0)