vendor/umimeweby/uw-login-user-bundle/src/Controller/UserLoginForm/LoginFormController.php line 25

Open in your IDE?
  1. <?php
  2. namespace Umimeweby\UWLoginUserBundle\Controller\UserLoginForm;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  5. use Umimeweby\UWLoginUserBundle\Contracts\Service\Security\LoginViewProviderInterface;
  6. class LoginFormController extends AbstractController
  7. {
  8.     private $authUtils;
  9.     private $loginViewProvider;
  10.     public function __construct(
  11.         AuthenticationUtils $authUtils,
  12.         LoginViewProviderInterface $loginViewProvider
  13. ) {
  14.         $this->authUtils $authUtils;
  15.         $this->loginViewProvider $loginViewProvider;
  16.     }
  17.     public function formlogin()
  18.     {
  19.         // get the login error if there is one
  20.         $error $this->authUtils->getLastAuthenticationError();
  21.         // last username entered by the user
  22.         $lastUsername $this->authUtils->getLastUsername();
  23.         $templatePath $this->loginViewProvider->getLoginPageViewTemplatePath();
  24.         return $this->render($templatePath, [
  25.             'error' => $error,
  26.             'last_username' => $lastUsername,
  27.         ]);
  28.     }
  29.     public function logout()
  30.     {
  31.         throw new \Exception('this should not be reached!');
  32.     }
  33.     public function loginCheckAction()
  34.     {
  35.         throw new \Exception('this should not be reached!');
  36.     }
  37. }