src/Controller/LoginController.php line 25

  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use App\Services\FlagsService;
  9. class LoginController extends AbstractController
  10. {   
  11.     private $flagsService;
  12.     public function __construct(FlagsService $flagsService)
  13.     {
  14.         $this->flagsService $flagsService;
  15.     }
  16.     /**
  17.      * @Route("/{_locale}/login", name="login")
  18.      */
  19.     public function login(AuthenticationUtils $authenticationUtilsRequest $request): Response
  20.     {
  21.         $error $authenticationUtils->getLastAuthenticationError();
  22.         $lastUsername $authenticationUtils->getLastUsername();
  23.           
  24.         $flags $this->flagsService->getflags();
  25.         return $this->render('login.html.twig', ['last_username' => $lastUsername'error' => $error'flags' => $flags]);
  26.     }
  27.     #[Route(path'/{_locale}/logout'name'logout')]
  28.     public function logout(): void
  29.     {}
  30. }