Skip to content

Commit

Permalink
fix: apply changes from code review (argument injection)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpolaszek committed Dec 20, 2020
1 parent 2857c68 commit dfa4861
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions DependencyInjection/LexikJWTAuthenticationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public function load(array $configs, ContainerBuilder $container)
->getDefinition('lexik_jwt_authentication.handler.authentication_success')
->replaceArgument(2, new IteratorArgument($cookieProviders));
}

$container
->getDefinition('lexik_jwt_authentication.generate_keypair_command')
->replaceArgument(1, $config['secret_key'])
->replaceArgument(2, $config['public_key'])
->replaceArgument(3, $config['pass_phrase']);
}

private static function createTokenExtractors(ContainerBuilder $container, array $tokenExtractorsConfig)
Expand Down
6 changes: 3 additions & 3 deletions Resources/config/console.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

<service id="lexik_jwt_authentication.generate_keypair_command" class="Lexik\Bundle\JWTAuthenticationBundle\Command\GenerateKeyPairCommand">
<argument type="service" id="filesystem" />
<argument type="string">%env(default::resolve:JWT_SECRET_KEY)%</argument>
<argument type="string">%env(default::resolve:JWT_PUBLIC_KEY)%</argument>
<argument type="string">%env(default::JWT_PASSPHRASE)%</argument>
<argument />
<argument />
<argument />
<tag name="console.command" command="lexik:jwt:generate-keypair" />
</service>
</services>
Expand Down

0 comments on commit dfa4861

Please sign in to comment.