<?php
namespace App\Controller;
use App\Breadcrumbs\Login;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends BaseController
{
/**
* @Route("/", name="security.login")
* @param AuthenticationUtils $authenticationUtils
* @return Response
*/
public function login(AuthenticationUtils $authenticationUtils)
{
if (null !== $this->getUser()) {
return $this->redirectToRoute('admin.dashboard');
}
$error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
$this->breadcrumbs()->create(new Login());
return $this->render('security/login.html.twig', [
'last_username' => $lastUsername,
'error' => $error,
]);
}
/**
* @Route("/logout", name="app.logout")
*/
public function logout()
{
}
}