Просмотр исходного кода

Fix bug due to breaking changes

Jaap Marcus 1 год назад
Родитель
Сommit
4e05a5a379
2 измененных файлов с 5 добавлено и 2 удалено
  1. 2 1
      web/inc/2fa/check.php
  2. 3 1
      web/inc/2fa/secret.php

+ 2 - 1
web/inc/2fa/check.php

@@ -1,5 +1,6 @@
 <?php
 use RobThree\Auth\TwoFactorAuth;
+use RobThree\Auth\Providers\Qr\QRServerProvider;
 require_once __DIR__ . "/../vendor/autoload.php";
 
 if (isset($argv[1]) && isset($argv[2])) {
@@ -13,7 +14,7 @@ if (isset($argv[1]) && isset($argv[2])) {
 	exit();
 }
 
-$tfa = new TwoFactorAuth("Hestia Control Panel");
+$tfa = new TwoFactorAuth(new QRServerProvider(), "Hestia Control Panel");
 
 // Verify code
 $result = $tfa->verifyCode($secret, $token);

+ 3 - 1
web/inc/2fa/secret.php

@@ -1,8 +1,10 @@
 <?php
 
 use RobThree\Auth\TwoFactorAuth;
+use RobThree\Auth\Providers\Qr\QRServerProvider;
+
 require_once __DIR__ . "/../vendor/autoload.php";
-$tfa = new TwoFactorAuth("Hestia Control Panel");
+$tfa = new TwoFactorAuth(new QRServerProvider(), "Hestia Control Panel");
 
 $secret = $tfa->createSecret(160); // Though the default is an 80 bits secret (for backwards compatibility reasons) we recommend creating 160+ bits secrets (see RFC 4226 - Algorithm Requirements)
 $qrcode = $tfa->getQRCodeImageAsDataUri(gethostname(), $secret);