<?php
/**
* Created by simpson <simpsonwork@gmail.com>
* Date: 2019-07-16
* Time: 14:28
*/
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Component\Routing\Annotation\Route;
class AccountAuthenticationController extends AbstractController
{
#[Route(path: '/login-form/', name: 'login')]
public function login(AuthenticationUtils $authenticationUtils): Response
{
return $this->render(
'security/login.html.twig',
[
'last_username' => $authenticationUtils->getLastUsername(),
'error' => $authenticationUtils->getLastAuthenticationError()
]
);
}
#[Route(path: '/sign-out/', name: 'logout')]
public function logout(): never
{
throw new \Exception('this should not be reached');
}
}