Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update custom_conditions.rst to work under Symfony 6.x #223

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/custom_conditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Bypassing Two-Factor Authentication
If you simply wish to bypass 2fa for a specific authenticator, setting the
``TwoFactorAuthenticator::FLAG_2FA_COMPLETE`` attribute on the security token will achieve this.

For example, if you are building a `custom Authenticator <https://symfony.com/doc/5.4/security/experimental_authenticators.html#creating-a-custom-authenticator>`_
For example, if you are building a `custom Authenticator <https://symfony.com/doc/current/security/custom_authenticator.html>`_
this would bypass 2fa when the authenticator is used:

.. code-block:: php
Expand All @@ -46,11 +46,11 @@ this would bypass 2fa when the authenticator is used:
use Scheb\TwoFactorBundle\Security\Http\Authenticator\TwoFactorAuthenticator;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Authenticator\AbstractAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;

class MyAuthenticator extends AbstractAuthenticator
{
public function createAuthenticatedToken(PassportInterface $passport, string $firewallName): TokenInterface
public function createToken(Passport $passport, string $firewallName): TokenInterface
{
$token = parent::createAuthenticatedToken($passport, $firewallName);

Expand Down
Loading