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. # 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. # Remove or comment this section to explicitly disable session support.
session: session:
handler_id: null handler_id: session.handler.native_file
cookie_secure: auto save_path: '%kernel.project_dir%/var/sessions'
cookie_samesite: lax # handler_id: null
storage_factory_id: session.storage.factory.native # cookie_secure: auto
# cookie_samesite: lax
# storage_factory_id: session.storage.factory.native
#esi: true #esi: true
#fragments: true #fragments: true

View File

@ -31,7 +31,7 @@ class DashboardController extends AbstractDashboardController
public function configureMenuItems(): iterable 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::section('Products', 'fas fa-folder-open');
yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home'); yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home');

View File

@ -3,7 +3,13 @@
namespace App\Controller\Admin; namespace App\Controller\Admin;
use App\Entity\User; use App\Entity\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; 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 class UserCrudController extends AbstractCrudController
{ {
@ -12,14 +18,20 @@ class UserCrudController extends AbstractCrudController
return User::class; return User::class;
} }
/*
public function configureFields(string $pageName): iterable public function configureFields(string $pageName): iterable
{ {
return [ $fields = [];
IdField::new('id'),
TextField::new('title'), switch ($pageName) {
TextEditorField::new('description'), 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'); return $this->render('base/base.html.twig');
} }
#[Route('/')] #[Route('/', name: 'home')]
public function home() public function home()
{ {
return $this->render('base/base.html.twig'); return $this->render('base/base.html.twig');