Browse Source

Merge pull request #4410 from hestiacp/dependencies/robthree-twofactorauth-3.x

Update dependency robthree/twofactorauth to v3
Jaap Marcus 1 year ago
parent
commit
22483a7006
4 changed files with 13 additions and 10 deletions
  1. 2 1
      web/inc/2fa/check.php
  2. 3 1
      web/inc/2fa/secret.php
  3. 1 1
      web/inc/composer.json
  4. 7 7
      web/inc/composer.lock

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

+ 1 - 1
web/inc/composer.json

@@ -2,6 +2,6 @@
     "require": {
         "phpmailer/phpmailer": "6.9.1",
         "hestiacp/phpquoteshellarg": "1.0.2",
-        "robthree/twofactorauth": "2.1.0"
+        "robthree/twofactorauth": "3.0.0"
     }
 }

+ 7 - 7
web/inc/composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "7baaf7f37456e01a8ec4aeab69083cad",
+    "content-hash": "3e0b7eec1b80b5e5ca986e8b9ef7e021",
     "packages": [
         {
             "name": "hestiacp/phpquoteshellarg",
@@ -127,20 +127,20 @@
         },
         {
             "name": "robthree/twofactorauth",
-            "version": "v2.1.0",
+            "version": "v3.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/RobThree/TwoFactorAuth.git",
-                "reference": "ab93dd41ced7818ecda83a37c2741ee38bb72fb7"
+                "reference": "ec82d397ee6e66f382ce1ebd16d45549f3c2274b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/ab93dd41ced7818ecda83a37c2741ee38bb72fb7",
-                "reference": "ab93dd41ced7818ecda83a37c2741ee38bb72fb7",
+                "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/ec82d397ee6e66f382ce1ebd16d45549f3c2274b",
+                "reference": "ec82d397ee6e66f382ce1ebd16d45549f3c2274b",
                 "shasum": ""
             },
             "require": {
-                "php": ">=8.1.0"
+                "php": ">=8.2.0"
             },
             "require-dev": {
                 "friendsofphp/php-cs-fixer": "^3.13",
@@ -204,7 +204,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2023-11-14T12:50:27+00:00"
+            "time": "2024-05-27T10:23:05+00:00"
         }
     ],
     "packages-dev": [],