Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Fix wrongly configured form renderer #227
Browse files Browse the repository at this point in the history
  • Loading branch information
scheb committed Jul 10, 2019
1 parent 2381488 commit 8d6994e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Resources/config/two_factor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

<service id="scheb_two_factor.security.form_renderer" class="Scheb\TwoFactorBundle\Security\TwoFactor\Provider\DefaultTwoFactorFormRenderer" lazy="true">
<argument type="service" id="twig" />
<argument>%scheb_two_factor.email.template%</argument>
<argument>@SchebTwoFactor/Authentication/form.html.twig</argument>
</service>

<!-- Alias for auto-wiring -->
Expand Down
5 changes: 4 additions & 1 deletion Resources/config/two_factor_provider_email.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

<service id="scheb_two_factor.security.email.code_generator" alias="scheb_two_factor.security.email.default_code_generator" />

<service id="scheb_two_factor.security.email.form_renderer" alias="scheb_two_factor.security.form_renderer" />
<service id="scheb_two_factor.security.email.form_renderer" class="Scheb\TwoFactorBundle\Security\TwoFactor\Provider\DefaultTwoFactorFormRenderer" lazy="true">
<argument type="service" id="twig" />
<argument>%scheb_two_factor.email.template%</argument>
</service>

<service id="scheb_two_factor.security.email.provider" class="Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Email\EmailTwoFactorProvider">
<tag name="scheb_two_factor.provider" alias="email" />
Expand Down
5 changes: 4 additions & 1 deletion Resources/config/two_factor_provider_google.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<argument>%scheb_two_factor.google.window%</argument>
</service>

<service id="scheb_two_factor.security.google.form_renderer" alias="scheb_two_factor.security.form_renderer" />
<service id="scheb_two_factor.security.google.form_renderer" class="Scheb\TwoFactorBundle\Security\TwoFactor\Provider\DefaultTwoFactorFormRenderer" lazy="true">
<argument type="service" id="twig" />
<argument>%scheb_two_factor.google.template%</argument>
</service>

<service id="scheb_two_factor.security.google.provider" class="Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorTwoFactorProvider">
<tag name="scheb_two_factor.provider" alias="google" />
Expand Down
5 changes: 4 additions & 1 deletion Resources/config/two_factor_provider_totp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<argument>%scheb_two_factor.totp.window%</argument>
</service>

<service id="scheb_two_factor.security.totp.form_renderer" alias="scheb_two_factor.security.form_renderer" />
<service id="scheb_two_factor.security.totp.form_renderer" class="Scheb\TwoFactorBundle\Security\TwoFactor\Provider\DefaultTwoFactorFormRenderer" lazy="true">
<argument type="service" id="twig" />
<argument>%scheb_two_factor.totp.template%</argument>
</service>

<service id="scheb_two_factor.security.totp.provider" class="Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Totp\TotpAuthenticatorTwoFactorProvider">
<tag name="scheb_two_factor.provider" alias="totp" />
Expand Down
5 changes: 2 additions & 3 deletions Tests/DependencyInjection/SchebTwoFactorExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public function load_googleAuthEnabled_loadGoogleServices(): void

$this->assertHasDefinition('scheb_two_factor.security.google_totp_factory');
$this->assertHasDefinition('scheb_two_factor.security.google_authenticator');
$this->assertHasDefinition('scheb_two_factor.security.google.form_renderer');
$this->assertHasDefinition('scheb_two_factor.security.google.provider');
$this->assertAlias('scheb_two_factor.security.google.form_renderer', 'scheb_two_factor.security.form_renderer');
}

/**
Expand All @@ -146,8 +146,8 @@ public function load_totpAuthEnabled_loadTotpFactoryServices(): void

$this->assertHasDefinition('scheb_two_factor.security.totp_factory');
$this->assertHasDefinition('scheb_two_factor.security.totp_authenticator');
$this->assertHasDefinition('scheb_two_factor.security.totp.form_renderer');
$this->assertHasDefinition('scheb_two_factor.security.totp.provider');
$this->assertAlias('scheb_two_factor.security.totp.form_renderer', 'scheb_two_factor.security.form_renderer');
}

/**
Expand All @@ -161,7 +161,6 @@ public function load_emailAuthEnabled_loadEmailServices(): void
$this->assertHasDefinition('scheb_two_factor.security.email.default_auth_code_mailer');
$this->assertHasDefinition('scheb_two_factor.security.email.default_code_generator');
$this->assertHasDefinition('scheb_two_factor.security.email.provider');
$this->assertAlias('scheb_two_factor.security.email.form_renderer', 'scheb_two_factor.security.form_renderer');
}

/**
Expand Down

0 comments on commit 8d6994e

Please sign in to comment.