Skip to content

Commit 22483a7

Browse files
authored
Merge pull request hestiacp#4410 from hestiacp/dependencies/robthree-twofactorauth-3.x
Update dependency robthree/twofactorauth to v3
2 parents b38d3bc + 4e05a5a commit 22483a7

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
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);

web/inc/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"require": {
33
"phpmailer/phpmailer": "6.9.1",
44
"hestiacp/phpquoteshellarg": "1.0.2",
5-
"robthree/twofactorauth": "2.1.0"
5+
"robthree/twofactorauth": "3.0.0"
66
}
77
}

web/inc/composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)