Fix user login

This commit is contained in:
Tim 2021-12-29 02:11:10 +01:00
parent 680a0841b8
commit 3b0c9ff4ca
4 changed files with 27 additions and 13 deletions

View File

@ -7,10 +7,12 @@ framework:
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native
handler_id: session.handler.native_file
save_path: '%kernel.project_dir%/var/sessions'
# handler_id: null
# cookie_secure: auto
# cookie_samesite: lax
# storage_factory_id: session.storage.factory.native
#esi: true
#fragments: true

View File

@ -31,7 +31,7 @@ class DashboardController extends AbstractDashboardController
public function configureMenuItems(): iterable
{
// yield MenuItem::linktoRoute('Back to home', 'fas fa-home', 'home');
yield MenuItem::linktoRoute('Back to home', 'fas fa-home', 'home');
yield MenuItem::section('Products', 'fas fa-folder-open');
yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home');

View File

@ -3,7 +3,13 @@
namespace App\Controller\Admin;
use App\Entity\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\ArrayField;
use EasyCorp\Bundle\EasyAdminBundle\Field\BooleanField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
class UserCrudController extends AbstractCrudController
{
@ -12,14 +18,20 @@ class UserCrudController extends AbstractCrudController
return User::class;
}
/*
public function configureFields(string $pageName): iterable
{
return [
IdField::new('id'),
TextField::new('title'),
TextEditorField::new('description'),
];
$fields = [];
switch ($pageName) {
case Crud::PAGE_INDEX:
case Crud::PAGE_DETAIL:
$fields[] = IdField::new('id');
}
*/
$fields[] = TextField::new('username');
$fields[] = ArrayField::new('roles');
return $fields;
}
}

View File

@ -14,7 +14,7 @@ class TestController extends AbstractController
return $this->render('base/base.html.twig');
}
#[Route('/')]
#[Route('/', name: 'home')]
public function home()
{
return $this->render('base/base.html.twig');