Major refactoring to include frontend...

This commit is contained in:
2025-03-28 16:02:03 +01:00
parent 4edf1516dd
commit bda0b74cbd
94 changed files with 91073 additions and 436 deletions

View File

@@ -6,13 +6,14 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class SecurityController extends AbstractController
class HomeController extends AbstractController
{
#[Route('/login', name: 'app_login')]
#[Route('/', name: 'app_home')]
public function index(): Response
{
return $this->json([
$this->getUser()?->getId() ?? null
return $this->render('home/index.html.twig', [
'controller_name' => 'HomeController',
]);
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Controller;
use App\Entity\User;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class LoginController extends AbstractController
{
#[Route('/login', name: 'app_login')]
public function index(AuthenticationUtils $authenticationUtils): Response
{
$error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('login/index.html.twig', [
'last_username' => $lastUsername,
'error' => $error,
]);
}
}