vendor/symfony/security-http/Authentication/CustomAuthenticationSuccessHandler.php line 40

  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\Security\Http\Authentication;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  14. /**
  15.  * @author Fabien Potencier <fabien@symfony.com>
  16.  */
  17. class CustomAuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface
  18. {
  19.     private AuthenticationSuccessHandlerInterface $handler;
  20.     /**
  21.      * @param array $options Options for processing a successful authentication attempt
  22.      */
  23.     public function __construct(AuthenticationSuccessHandlerInterface $handler, array $optionsstring $firewallName)
  24.     {
  25.         $this->handler $handler;
  26.         if (method_exists($handler'setOptions')) {
  27.             $this->handler->setOptions($options);
  28.         }
  29.         if (method_exists($handler'setFirewallName')) {
  30.             $this->handler->setFirewallName($firewallName);
  31.         }
  32.     }
  33.     public function onAuthenticationSuccess(Request $requestTokenInterface $token): ?Response
  34.     {
  35.         return $this->handler->onAuthenticationSuccess($request$token);
  36.     }
  37. }