src/Controller/AccountController.php line 20

  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Component\HttpFoundation\Response;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. class AccountController extends AbstractController
  8. {
  9.     /**
  10.      * Connect to the administration
  11.      *
  12.      * @param AuthenticationUtils $utils
  13.      * @return Response
  14.      */
  15.     #[Route('/', name: 'account_login')]
  16.     public function index(AuthenticationUtils $utils): Response
  17.     {
  18.         $error = $utils->getLastAuthenticationError();
  19.         $username = $utils->getLastUsername();
  20.         return $this->render('account/index.html.twig', [
  21.             'hasError' => $error !== null,
  22.             'username' => $username
  23.         ]);
  24.     }
  25.      /**
  26.      * Permet la déconnexion de l'utilisateur
  27.      *
  28.      * @return void
  29.      */
  30.     #[Route("/logout", name:"account_logout")]
  31.     public function logout():void
  32.     {
  33.         //
  34.     }
  35. }