composer install
symfony serve
symfony new symfony5-auth-demo-login
cd symfony5-auth-demo-login
symfony composer req maker
symfony composer req security
symfony composer req orm
# enable sqlite config in .env
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"//
symfony console make:user
symfony composer req annotations
symfony composer req twig
symfony console make:auth
symfony console debug:router
# load test user into database
symfony composer req orm-fixtures
symfony console make:migration
symfony console doctrine:mi:mi -n
symfony console make:fixtures
symfony console doctrine:fixtures:load
symfony composer require --dev symfony/profiler-pack
symfony console make:controller # ProfileController
# protect the profile in controller
$this->denyAccessUnlessGranted('ROLE_USER');
# update the redirect URL in LoginFormAuthenticator
new RedirectResponse($this->urlGenerator->generate('app_profile'));
# complete the implementation in LoginFormAuthenticator
more detailed info in
cli-protocol.md
MIT @vikbert