src/Controller/SecurityController.php line 29

  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Referentiel\RefUser;
  4. use App\Entity\Customer\UsrUtilisateur;
  5. use App\Entity\Referentiel\RefUserCustomer;
  6. use Doctrine\ORM\EntityManagerInterface;
  7. use Doctrine\Persistence\ManagerRegistry;
  8. use Symfony\Component\HttpFoundation\Request;
  9. use Symfony\Component\HttpFoundation\Response;
  10. use Symfony\Component\Routing\Annotation\Route;
  11. use Symfony\Component\HttpFoundation\JsonResponse;
  12. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  13. use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
  14. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  15. use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
  16. use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
  17. use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\PasswordCredentials;
  18. class SecurityController extends AbstractController
  19. {
  20.     #[Route(path'/login'name'app_login')]
  21.     public function login(AuthenticationUtils $authenticationUtils): Response
  22.     {
  23.         $error $authenticationUtils->getLastAuthenticationError();
  24.         $lastUsername $authenticationUtils->getLastUsername();
  25.         return $this->render('security/login.html.twig', [
  26.             'last_username' => $lastUsername
  27.             'error' => $error
  28.         ]);
  29.     }
  30.     #[Route(path'/logout'name'app_logout')]
  31.     public function logout(): void
  32.     {
  33.         throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
  34.     }
  35.     
  36. }