zend-blog-3-backend

Форк
0
/
SecurityController.php 
32 строки · 817.0 Байт
1
<?php
2

3
namespace App\Controller;
4

5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
6
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7
use Symfony\Component\Routing\Annotation\Route;
8
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
9

10
class SecurityController extends AbstractController
11
{
12
    private AuthenticationUtils $authUtils;
13

14
    public function __construct(AuthenticationUtils $authUtils)
15
    {
16
        $this->authUtils = $authUtils;
17
    }
18

19
    /**
20
     * @Route("/login")
21
     * @Template()
22
     *
23
     * @return array
24
     */
25
    public function loginAction(): array
26
    {
27
        $error = $this->authUtils->getLastAuthenticationError();
28
        $lastUsername = $this->authUtils->getLastUsername();
29

30
        return compact('error', 'lastUsername');
31
    }
32
}
33

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.