2FA QR Codes

Move away from the Google Charts API for generating QR codes as this is currently broken and not a security best practice.
This commit is contained in:
Marcus Hill
2024-05-26 16:08:06 +01:00
parent c02d6d4cf0
commit 8b1ba7028e
4 changed files with 3355 additions and 12 deletions

View File

@@ -36,8 +36,9 @@ require_once "header.php";
if (!empty($session_token)) {
//Generate QR Code based off the generated key
print sprintf('<img src="%s"/>', TokenAuth6238::getBarCodeUrl($session_name, ' ', $session_token, $_SERVER['SERVER_NAME']));
// Generate QR Code
$data = "otpauth://totp/ITFlow:$session_email?secret=$session_token";
print "<img src='plugins/barcode/barcode.php?f=png&s=qr&d=$data'>";
echo "<p class='text-secondary'>$session_token</p>";
}