src/Controller/LoginController.php line 25
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Component\HttpFoundation\Request;
use App\Services\FlagsService;
class LoginController extends AbstractController
{
private $flagsService;
public function __construct(FlagsService $flagsService)
{
$this->flagsService = $flagsService;
}
/**
* @Route("/{_locale}/login", name="login")
*/
public function login(AuthenticationUtils $authenticationUtils, Request $request): Response
{
$error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
$flags = $this->flagsService->getflags();
return $this->render('login.html.twig', ['last_username' => $lastUsername, 'error' => $error, 'flags' => $flags]);
}
#[Route(path: '/{_locale}/logout', name: 'logout')]
public function logout(): void
{}
}