Yes. I know this. But the problem is, that the $event->cookieBased is false. The secretKey and $this->owner_enableSession are not empty or false.
So the script will set the $event->isValid to false. And so the application will not login the user.
If i change the script and set the $event->isValid to true, the application logged in the user.
public function beforeLogin(UserEvent $event)
{
if (!$event->isValid) {
return;
}
if (!$event->identity instanceof IdentityInterface) {
throw new InvalidValueException("{$this->owner->identityClass}::findIdentity() must return an object implementing \\vxm\\mfa\\IdentityInterface.");
}
$secretKey = $event->identity->getMfaSecretKey();
if (!empty($secretKey) && $this->owner->enableSession && !$event->cookieBased) {
$event->isValid = true;
$this->saveIdentityLoggedIn($event->identity, $event->duration);
$this->verifyRequired();
}
}
But then i have another error with the QrCodeWidget.
I look now at this error and hope that i will found a solution.