src/Controller/SecurityController.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\User;
  4. use App\Repository\UserRepository;
  5. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Mailer\MailerInterface;
  8. use Symfony\Component\Mime\Email;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  11. use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface;
  12. class SecurityController extends AbstractController
  13. {
  14.     #[Route(path'/login 'name'app_login')]
  15.     /**
  16.      * Cette fonction rĂ©dirige l'utilsateur sur la page de connexion
  17.      * avec les erreurs Ă©ventuelles
  18.      *
  19.      * @param AuthenticationUtils $authenticationUtils
  20.      * @return Response
  21.      */
  22.     public function login(AuthenticationUtils $authenticationUtils): Response
  23.     {
  24.         $error $authenticationUtils->getLastAuthenticationError();
  25.         $lastUsername $authenticationUtils->getLastUsername();
  26.         return $this->render(
  27.             'security/connexion.html.twig',
  28.             ['last_username' => $lastUsername'error' => $error]
  29.         );
  30.     }
  31.     #[Route(path'/logout'name'app_logout')]
  32.     public function logout(): void
  33.     {
  34.     }
  35. }