This commit is contained in:
smiley
2017-11-24 03:02:00 +01:00
parent 7ea7b3c85a
commit 88f800c50b
22 changed files with 215 additions and 406 deletions
-27
View File
@@ -1,27 +0,0 @@
<?php
/**
*
* @filesource authenticator.php
* @created 10.11.2017
* @author Smiley <smiley@chillerlan.net>
* @copyright 2017 Smiley
* @license MIT
*/
require_once '../vendor/autoload.php';
use chillerlan\{
GoogleAuth\Authenticator,
QRCode\QRCode,
QRCode\Output\QRMarkup
};
$authenticator = new Authenticator;
$secret = $authenticator->createSecret(); // -> userdata
$data = $authenticator->getUri($secret, 'label', 'example.com');
// markup - svg
echo '<!DOCTYPE html><html><head><meta charset="UTF-8"/></head><body><div>'.(new QRCode($data, new QRMarkup))->output().'</div></body>';