src/Controller/AuthenticationController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  8. use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
  9. use Symfony\Component\Security\Guard\GuardAuthenticatorHandler;
  10. use App\Security\LoginFormAuthenticator;
  11. use App\Entity\CustomerUser;
  12. class AuthenticationController extends AbstractController
  13. {
  14.     /**
  15.      * Index
  16.      */
  17.     public function index(){
  18.          //Controlla se l'utente è loggato
  19.          $logged false;
  20.          //Se non è loggato vai alla pagina di login
  21.          if(!$logged){
  22.              return $this->render('login.html.twig', [
  23.              
  24.                  ]);    
  25.          }
  26.     }
  27.     /**
  28.      *
  29.      */
  30.     public function login(AuthenticationUtils $authenticationUtils): Response
  31.     {
  32.         die('OK');
  33.         // get the login error if there is one
  34.         $error $authenticationUtils->getLastAuthenticationError();
  35.         // last username entered by the user
  36.         $lastUsername $authenticationUtils->getLastUsername();
  37.         return $this->render('login.html.twig', [
  38.             'last_username' => $lastUsername,
  39.             'error' => $error
  40.         ]);
  41.     }
  42. }