src/Controller/Account/SecurityController.php line 15
<?php
namespace App\Controller\Account;
use App\Entity\AppConstants;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController
{
#[Route('/login/{evenement_reference}', name: 'app_user_login')]
public function index(Request $request, AuthenticationUtils $authenticationUtils, ?string $evenement_reference = null)
{
$session = $request->getSession();
if ($evenement_reference) {
$session->set(AppConstants::SESSION_EVENEMENT_REFERENCE, $evenement_reference);
}
$error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('account/login/login.html.twig', [
'last_username' => $lastUsername,
'error' => $error,
]);
}
#[Route('/logout', name: 'app_user_logout', methods: ['GET'])]
public function logout()
{
// controller can be blank: it will never be called!
throw new \Exception('Don\'t forget to activate logout in security.yaml');
}
}