src/Controller/SecurityController.php line 14
<?php
namespace App\Controller;
use Exception;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController
{
#[Route(path: "/login", name: "login")]
public function login(AuthenticationUtils $authenticationUtils): Response
{
$error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('@EasyAdmin/page/login.html.twig', [
'error' => $error,
'last_username' => $lastUsername,
'remember_me_enabled' => true,
]);
}
#[Route(path: "/logout", name: "logout", methods: ["GET"])]
public function logout(): void
{
throw new Exception('Don\'t forget to activate logout in security.yaml');
}
}