Skip to content

Commit

Permalink
Merge pull request #51 from jbtronics/symfony5-support
Browse files Browse the repository at this point in the history
Add Symfony5 support
  • Loading branch information
darookee authored May 19, 2020
2 parents 47e50bf + 934e1c9 commit 36d8b6a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Controller/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use R\U2FTwoFactorBundle\Event\RegisterEvent;
use R\U2FTwoFactorBundle\Security\TwoFactor\Provider\U2F\U2FAuthenticator;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
Expand All @@ -30,12 +31,14 @@ public function __construct(
U2FAuthenticator $u2fAuthenticator,
SessionInterface $session,
EventDispatcherInterface $eventDispatcher,
ContainerInterface $container,
string $registerTemplate
) {
$this->u2fAuthenticator = $u2fAuthenticator;
$this->session = $session;
$this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher);
$this->registerTemplate = $registerTemplate;
$this->container = $container;
}

public function u2fAction(Request $request): Response
Expand Down
2 changes: 1 addition & 1 deletion Event/RegisterEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace R\U2FTwoFactorBundle\Event;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Contracts\EventDispatcher\Event;
use Symfony\Component\HttpFoundation\Response;
use R\U2FTwoFactorBundle\Model\U2F\TwoFactorInterface;
use u2flib_server\Registration;
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
club_base_register_u2f:
path: /u2f_register
defaults: { _controller: RU2FTwoFactorBundle:Register:u2f }
defaults: { _controller: R\U2FTwoFactorBundle\Controller\RegisterController::u2fAction }
1 change: 1 addition & 0 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ services:
arguments:
$u2fAuthenticator: '@R\U2FTwoFactorBundle\Security\TwoFactor\Provider\U2F\U2FAuthenticator'
$session: '@session'
$container: '@service_container'
$eventDispatcher: '@event_dispatcher'
$registerTemplate: '%r_u2f_two_factor.registerTemplate%'
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
"doctrine/common": "*",
"scheb/two-factor-bundle": "^3.2.0|^4.0.0",
"yubico/u2flib-server": "^1.0.0",
"symfony/framework-bundle": "^3.4|^4.0",
"symfony/templating": "^3.4|^4.0",
"doctrine/collections": "^1.6"
"symfony/framework-bundle": "^3.4|^4.0|^5.0",
"symfony/templating": "^3.4|^4.0|^5.0",
"doctrine/collections": "^1.6",
"symfony/event-dispatcher-contracts": "^2.0"
},
"conflict": {
"tubssz/u2f-two-factor-bundle": "*",
Expand Down

0 comments on commit 36d8b6a

Please sign in to comment.