Skip to content

Commit 4e05a5a

Browse files
committed
Fix bug due to breaking changes
1 parent 850c133 commit 4e05a5a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

web/inc/2fa/check.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
use RobThree\Auth\TwoFactorAuth;
3+
use RobThree\Auth\Providers\Qr\QRServerProvider;
34
require_once __DIR__ . "/../vendor/autoload.php";
45

56
if (isset($argv[1]) && isset($argv[2])) {
@@ -13,7 +14,7 @@
1314
exit();
1415
}
1516

16-
$tfa = new TwoFactorAuth("Hestia Control Panel");
17+
$tfa = new TwoFactorAuth(new QRServerProvider(), "Hestia Control Panel");
1718

1819
// Verify code
1920
$result = $tfa->verifyCode($secret, $token);

web/inc/2fa/secret.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

33
use RobThree\Auth\TwoFactorAuth;
4+
use RobThree\Auth\Providers\Qr\QRServerProvider;
5+
46
require_once __DIR__ . "/../vendor/autoload.php";
5-
$tfa = new TwoFactorAuth("Hestia Control Panel");
7+
$tfa = new TwoFactorAuth(new QRServerProvider(), "Hestia Control Panel");
68

79
$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)
810
$qrcode = $tfa->getQRCodeImageAsDataUri(gethostname(), $secret);

0 commit comments

Comments
 (0)