vendor\gesdinet\jwt-refresh-token-bundle\GesdinetJWTRefreshTokenBundle.php line 15

Open in your IDE?
  1. <?php
  2. namespace Gesdinet\JWTRefreshTokenBundle;
  3. use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\AddExtractorsToChainCompilerPass;
  4. use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\CustomUserProviderCompilerPass;
  5. use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\ObjectManagerCompilerPass;
  6. use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\UserCheckerCompilerPass;
  7. use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Security\Factory\RefreshTokenAuthenticatorFactory;
  8. use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
  9. use Symfony\Component\DependencyInjection\ContainerBuilder;
  10. use Symfony\Component\HttpKernel\Bundle\Bundle;
  11. use Symfony\Component\Security\Http\RememberMe\RememberMeHandlerInterface;
  12. class GesdinetJWTRefreshTokenBundle extends Bundle
  13. {
  14.     public function build(ContainerBuilder $container): void
  15.     {
  16.         parent::build($container);
  17.         $container->addCompilerPass(new AddExtractorsToChainCompilerPass());
  18.         $container->addCompilerPass(new CustomUserProviderCompilerPass(true));
  19.         $container->addCompilerPass(new ObjectManagerCompilerPass());
  20.         $container->addCompilerPass(new UserCheckerCompilerPass(true));
  21.         // Only register the security authenticator for Symfony 5.4+
  22.         if (interface_exists(RememberMeHandlerInterface::class)) {
  23.             /** @var SecurityExtension $extension */
  24.             $extension $container->getExtension('security');
  25.             $extension->addAuthenticatorFactory(new RefreshTokenAuthenticatorFactory());
  26.         }
  27.     }
  28. }