Created
February 18, 2026 20:29
-
-
Save NicolasCARPi/8cab158ecbcf469d0974c101b764ba60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // https://github.com/RobThree/TwoFactorAuth/issues/157 | |
| // install dependency with: | |
| // docker run --rm -v $PWD:/app composer require robthree/twofactorauth | |
| require_once './vendor/autoload.php'; | |
| use RobThree\Auth\TwoFactorAuth; | |
| use RobThree\Auth\Providers\Qr\QRServerProvider; | |
| $tfa = new TwoFactorAuth(new QRServerProvider(), "test issue 157", period: 60); | |
| $secret = $tfa->createSecret(); | |
| $code = $tfa->getCode($secret); | |
| var_dump($tfa->verifyCode($secret, $code)); // bool(true) | |
| // run with php bug.php | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment