/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Security/Http/Authentication/CustomAuthenticationFailureHandler.php
40 строк
1 KB
Nicolas Grekas
[Security] Configure custom authentication handlers when they are called
12 авг 2026, 14:05
12 авг 2026, 14:05
08134ff
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\Authentication; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AuthenticationException; /** * @author Fabien Potencier <fabien@symfony.com> */ class CustomAuthenticationFailureHandler implements AuthenticationFailureHandlerInterface { /** * @param array $options Options for processing a successful authentication attempt */ public function __construct( private AuthenticationFailureHandlerInterface $handler, private array $options, ) { } public function onAuthenticationFailure(Request $request, AuthenticationException $exception): Response { if (method_exists($this->handler, 'setOptions')) { $this->handler->setOptions($this->options); } return $this->handler->onAuthenticationFailure($request, $exception); } }