src/Controller/LoginController.php line 19
<?php
declare(strict_types=1);
namespace App\Controller;
use App\Handler\Git;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
final class LoginController extends AbstractController
{
/**
* @Route("/", name="security_login")
*/
public function loginAction(AuthenticationUtils $authenticationUtils, Request $request, Git $git): Response
{
if ($this->isGranted('ROLE_USER')) {
return $this->redirectToRoute('dashboard');
}
return $this->render(
'userSecurity/login.html.twig',
[
'last_username' => $authenticationUtils->getLastUsername(),
'error' => $authenticationUtils->getLastAuthenticationError(),
'sessionIdle' => $request->query->get('session_idle'),
'lastCommitDate' => $git->getLastCommitDate()
]
);
}
/**
* @Route("/logout", name="security_logout")
*/
public function logoutAction(): void
{
}
}