src/Controller/Site/SecurityController.php
<?php
declare(strict_types=1);
namespace FrankProjects\UltimateWarfare\Controller\Site;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
final class SecurityController extends AbstractController
{
public function login(AuthenticationUtils $authUtils): Response
{
$error = $authUtils->getLastAuthenticationError();
$lastUsername = $authUtils->getLastUsername();
return $this->render(
'site/login.html.twig',
[
'last_username' => $lastUsername,
'error' => $error,
]
);
}
}