src/Controller/AccountAuthenticationController.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by simpson <simpsonwork@gmail.com>
  4.  * Date: 2019-07-16
  5.  * Time: 14:28
  6.  */
  7. namespace App\Controller;
  8. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  9. use Symfony\Component\HttpFoundation\Response;
  10. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  11. use Symfony\Component\Routing\Annotation\Route;
  12. class AccountAuthenticationController extends AbstractController
  13. {
  14.     #[Route(path'/login-form/'name'login')]
  15.     public function login(AuthenticationUtils $authenticationUtils): Response
  16.     {
  17.         return $this->render(
  18.             'security/login.html.twig',
  19.             [
  20.                 'last_username' => $authenticationUtils->getLastUsername(),
  21.                 'error' => $authenticationUtils->getLastAuthenticationError()
  22.             ]
  23.         );
  24.     }
  25.     #[Route(path'/sign-out/'name'logout')]
  26.     public function logout(): never
  27.     {
  28.         throw new \Exception('this should not be reached');
  29.     }
  30. }