Skip to content

Commit

Permalink
Merge pull request #94 from dunglas/autowiring
Browse files Browse the repository at this point in the history
Add support for autowiring
  • Loading branch information
Widcket authored Jun 22, 2020
2 parents 5317f37 + b1ab57c commit 87fccb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tests/Functional/BundleInitializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function testInitBundle()
$this->assertTrue($container->has('jwt_auth.auth0_service'));
$service = $container->get('jwt_auth.auth0_service');
$this->assertInstanceOf(Auth0Service::class, $service);

// Test if autowiring is working properly
$this->assertTrue($container->has(Auth0Service::class));
$service = $container->get(Auth0Service::class);
$this->assertInstanceOf(Auth0Service::class, $service);
}

public function testBundleWithCache()
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ services:
class: Auth0\JWTAuthBundle\Security\Auth0Service
arguments: ["%jwt_auth.api_secret%","%jwt_auth.domain%","%jwt_auth.api_identifier%","%jwt_auth.authorized_issuer%","%jwt_auth.secret_base64_encoded%", "%jwt_auth.supported_algs%", ~]

Auth0\JWTAuthBundle\Security\Auth0Service:
alias: jwt_auth.auth0_service

jwt_auth.jwt_authenticator:
class: Auth0\JWTAuthBundle\Security\JWTAuthenticator
arguments: ["@jwt_auth.auth0_service"]
Expand Down

0 comments on commit 87fccb0

Please sign in to comment.