forked from scheb/two-factor-bundle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSchebTwoFactorBundle.php
31 lines (25 loc) · 1.33 KB
/
SchebTwoFactorBundle.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
30
31
<?php
declare(strict_types=1);
namespace Scheb\TwoFactorBundle;
use Scheb\TwoFactorBundle\DependencyInjection\Compiler\AuthenticationProviderDecoratorCompilerPass;
use Scheb\TwoFactorBundle\DependencyInjection\Compiler\RememberMeServicesDecoratorCompilerPass;
use Scheb\TwoFactorBundle\DependencyInjection\Compiler\TwoFactorFirewallConfigCompilerPass;
use Scheb\TwoFactorBundle\DependencyInjection\Compiler\TwoFactorProviderCompilerPass;
use Scheb\TwoFactorBundle\DependencyInjection\Factory\Security\TwoFactorFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class SchebTwoFactorBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new AuthenticationProviderDecoratorCompilerPass());
$container->addCompilerPass(new RememberMeServicesDecoratorCompilerPass());
$container->addCompilerPass(new TwoFactorProviderCompilerPass());
$container->addCompilerPass(new TwoFactorFirewallConfigCompilerPass());
/** @var SecurityExtension $extension */
$extension = $container->getExtension('security');
$extension->addSecurityListenerFactory(new TwoFactorFactory());
}
}