-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #895 Fix unexpected deprecation about Guard (chalasr)
This PR was merged into the 2.x branch. Discussion ---------- Fix unexpected deprecation about Guard Fixes #891 Commits ------- cae3b1a Fix unexpected deprecation about Guard
- Loading branch information
Showing
4 changed files
with
39 additions
and
11 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
DependencyInjection/Compiler/RegisterLegacyGuardAuthenticatorPass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Lexik\Bundle\JWTAuthenticationBundle\DependencyInjection\Compiler; | ||
|
||
use Lexik\Bundle\JWTAuthenticationBundle\Security\Guard\JWTTokenAuthenticator; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; | ||
|
||
class RegisterLegacyGuardAuthenticatorPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->hasParameter('lexik_jwt_authentication.authenticator_manager_enabled') || !$container->getParameter('lexik_jwt_authentication.authenticator_manager_enabled')) { | ||
return; | ||
} | ||
|
||
$container->register('.lexik_jwt_authentication.pre_authentication_token_storage', TokenStorage::class); | ||
$container | ||
->register('lexik_jwt_authentication.security.guard.jwt_token_authenticator', JWTTokenAuthenticator::class) | ||
->setArguments([ | ||
new Reference('lexik_jwt_authentication.jwt_manager'), | ||
new Reference('event_dispatcher'), | ||
new Reference('lexik_jwt_authentication.extractor.chain_extractor'), | ||
new Reference('.lexik_jwt_authentication.pre_authentication_token_storage'), | ||
]) | ||
; | ||
$container->setAlias('lexik_jwt_authentication.jwt_token_authenticator', 'lexik_jwt_authentication.security.guard.jwt_token_authenticator'); | ||
$container->getParameterBag()->remove('lexik_jwt_authentication.authenticator_manager_enabled'); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters