<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Symfony\Component\Security\Guard\GuardAuthenticatorHandler;
use App\Security\LoginFormAuthenticator;
use App\Entity\CustomerUser;
class AuthenticationController extends AbstractController
{
/**
* Index
*/
public function index(){
//Controlla se l'utente è loggato
$logged = false;
//Se non è loggato vai alla pagina di login
if(!$logged){
return $this->render('login.html.twig', [
]);
}
}
/**
*
*/
public function login(AuthenticationUtils $authenticationUtils): Response
{
die('OK');
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('login.html.twig', [
'last_username' => $lastUsername,
'error' => $error
]);
}
}