-
Notifications
You must be signed in to change notification settings - Fork 159
/
GesdinetJWTRefreshTokenBundle.php
29 lines (24 loc) · 1.34 KB
/
GesdinetJWTRefreshTokenBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace Gesdinet\JWTRefreshTokenBundle;
use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\AddExtractorsToChainCompilerPass;
use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\CustomUserProviderCompilerPass;
use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\ObjectManagerCompilerPass;
use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Compiler\UserCheckerCompilerPass;
use Gesdinet\JWTRefreshTokenBundle\DependencyInjection\Security\Factory\RefreshTokenAuthenticatorFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class GesdinetJWTRefreshTokenBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new AddExtractorsToChainCompilerPass());
$container->addCompilerPass(new CustomUserProviderCompilerPass(true));
$container->addCompilerPass(new ObjectManagerCompilerPass());
$container->addCompilerPass(new UserCheckerCompilerPass(true));
/** @var SecurityExtension $extension */
$extension = $container->getExtension('security');
$extension->addAuthenticatorFactory(new RefreshTokenAuthenticatorFactory());
}
}