<?php
namespace App\Controller\Backend;
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;
#[Route('/admin')]
class SecurityController extends AbstractController
{
#[Route(path: '/login', name: 'app_login')]
public function login(AuthenticationUtils $authenticationUtils): Response
{
$error = $authenticationUtils->getLastAuthenticationError();
$lastUserName = $authenticationUtils->getLastUsername();
return $this->render('backend/security/login.html.twig', [
'last_username' => $lastUserName,
'error' => $error
]);
}
#[Route(path: '/logout', name: 'app_logout')]
public function logout()
{
throw new Exception('FFCB logout');
}
}