You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you please offer a bit of example how to use this? Ideally I would like to add to the LoginController (which has just 2 routes, /login and /logout) another route say... /2fa-resend and that would be it.
At the moment I have created src\Interface\LoginAuthCodeInterface where I send out a custom HTML email with the code (Mailer is a service).
<?php
namespace App\Interface;
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
use App\Service\Mailer;
class LoginAuthCodeInterface implements AuthCodeMailerInterface
{
private $mailer;
public function __construct(Mailer $mailer)
{
$this->mailer = $mailer;
}
public function sendAuthCode(TwoFactorInterface $user): void
{
$authCode = $user->getEmailAuthCode();
$this->mailer->send2Fa($authCode);
}
}
Not sure if this helps with anything, just mentioning it.
Many thanks!
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is not a bug report but rather a question. I would like to offer a link/button for the user to re-sent the code if he didn't received it.
Upon checking https://symfony.com/bundles/SchebTwoFactorBundle/6.x/providers/email.html#re-send-authentication-code I cannot understand how you can re-send the code from a custom route since it requires the $user interface.
Would you please offer a bit of example how to use this? Ideally I would like to add to the LoginController (which has just 2 routes, /login and /logout) another route say... /2fa-resend and that would be it.
At the moment I have created src\Interface\LoginAuthCodeInterface where I send out a custom HTML email with the code (Mailer is a service).
Not sure if this helps with anything, just mentioning it.
Many thanks!
The text was updated successfully, but these errors were encountered: