src/Controller/AccountAuthenticationController.php line 18

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. class AccountAuthenticationController extends AbstractController
  12. {
  13.     public function login(AuthenticationUtils $authenticationUtils): Response
  14.     {
  15.         return $this->render(
  16.             'security/login.html.twig',
  17.             [
  18.                 'last_username' => $authenticationUtils->getLastUsername(),
  19.                 'error' => $authenticationUtils->getLastAuthenticationError()
  20.             ]
  21.         );
  22.     }
  23.     public function logout(): never
  24.     {
  25.         throw new \Exception('this should not be reached');
  26.     }
  27. }