Skip to content

Commit

Permalink
Switch OAuth user checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Nikolaev committed Dec 3, 2019
1 parent 5b7c642 commit 507ab6c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DarvinUserBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@

namespace Darvin\UserBundle;

use Darvin\UserBundle\DependencyInjection\Compiler\SwitchOAuthUserCheckerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* User bundle
*/
class DarvinUserBundle extends Bundle
{
/**
* {@inheritDoc}
*/
public function build(ContainerBuilder $container): void
{
parent::build($container);

$container->addCompilerPass(new SwitchOAuthUserCheckerPass());
}
}
29 changes: 29 additions & 0 deletions DependencyInjection/Compiler/SwitchOAuthUserCheckerPass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php declare(strict_types=1);
/**
* @author Igor Nikolaev <[email protected]>
* @copyright Copyright (c) 2019, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Darvin\UserBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* Switch OAuth user checker compiler pass
*/
class SwitchOAuthUserCheckerPass implements CompilerPassInterface
{
/**
* {@inheritDoc}
*/
public function process(ContainerBuilder $container): void
{
$container->setAlias('hwi_oauth.user_checker', new Alias('darvin_user.security.user_checker'));
}
}

0 comments on commit 507ab6c

Please sign in to comment.