<?php
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use App\Settings\Settings;
use App\Helper\FormHelper;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
//use App\Entity\Season;
class SecurityController extends AbstractController {
/**
* @Route("/logout", name="logout", methods={"GET"})
*/
public function logout(): void
{
// controller can be blank: it will never be executed!
throw new \Exception('Don\'t forget to activate logout in security.yaml');
}
/**
* @Route("/login", name="login")
*/
public function loginAction(Request $request, AuthenticationUtils $authUtils) {
// get the login error if there is one
$error = $authUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authUtils->getLastUsername();
//var_dump($lastUsername);
//var_dump($error);
return $this->render('security/login.html.twig', array(
'last_username' => $lastUsername,
'commonData' => Settings::getCommonData(),
'error' => $error,
));
}
}