thiagogomesverissimo / symfony_traditional_login
Installs: 205
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Type:project
Requires
- php: ^7.1.3
- ext-iconv: *
- sensio/framework-extra-bundle: ^5.1
- symfony/asset: ^4.0
- symfony/console: ^4.0
- symfony/expression-language: ^4.0
- symfony/flex: ^1.0
- symfony/form: ^4.0
- symfony/framework-bundle: ^4.0
- symfony/lts: ^4@dev
- symfony/monolog-bundle: ^3.1
- symfony/orm-pack: *
- symfony/process: ^4.0
- symfony/security-bundle: ^4.0
- symfony/serializer-pack: *
- symfony/swiftmailer-bundle: ^3.1
- symfony/twig-bundle: ^4.0
- symfony/validator: ^4.0
- symfony/web-link: ^4.0
- symfony/webpack-encore-pack: *
- symfony/yaml: ^4.0
Requires (Dev)
Conflicts
This package is not auto-updated.
Last update: 2024-05-26 04:15:17 UTC
README
This project is an basic implementation of traditional login form with users from database on symfony, as described in the https://symfony.com/doc/current/security/form_login_setup.html and some codes from symfony demo
Included:
- login and logout routes configured
- web crud and commands to manage users in database
- passwords encoded with bcrypt
Not Included:
- Registration to anonymous
- Area to user to change the own password
The main reason for this project is to be a start point to another projects thet depends of local users to work.
Deploy
Download lastest release:
composer create-project thiagogomesverissimo/symfony_traditional_login
Download branch master:
composer create-project thiagogomesverissimo/symfony_traditional_login -s dev
Configure .env variables and run migrations (only for mysql users):
php bin/console doctrine:migrations:migrate
Up server:
php bin/console server:run
Three suggestions to create users on database:
1. To use data fixtures that create two users: admin and user, same for passwords:
php bin/console doctrine:fixtures:load
2. To use command:
php bin/console app:add-user user user123
php bin/console app:add-user admin admin123 --admin
php bin/console app:list-users
php bin/console app:delete-user admin
php bin/console app:delete-user user
3. For learning purposes, you can use psysh:
bin/console psysh
$em = $container->get('doctrine')->getManager()
$admin = new App\Entity\User
$admin->setUsername('admin')
$password = $container->get('security.password_encoder')->encodePassword($admin, 'admin')
$admin->setPassword($password)
$em->persist($admin)
$em->flush()