35 lines
929 B
PHP
35 lines
929 B
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
|
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: 'app_login')]
|
|
public function login(AuthenticationUtils $authenticationUtils): Response
|
|
{
|
|
return $this->render(view: 'security/login.html.twig', parameters: [
|
|
'error' => $authenticationUtils->getLastAuthenticationError(),
|
|
'last_username' => $authenticationUtils->getLastUsername()
|
|
]);
|
|
}
|
|
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
#[Route(path: '/logout', name: 'app_logout')]
|
|
public function logout()
|
|
{
|
|
throw new Exception(message: 'Logout should never be reached.');
|
|
}
|
|
}
|