Updated qr code generation code

This commit is contained in:
danwin1210 committed 2026-10-11 18:40:42 +02:00
1 parent b59dfe6d1d
commit 6e31c2e890
2 files changed
+12 -3

No files matched your search

+7 -3
View File
@@ -184,9 +184,13 @@ function get_totp_provisioning_uri( string $account, string $secret ): string
function get_totp_qr_data_uri( string $totp_uri ): string
{
$qrCode = \Endroid\QrCode\QrCode::create( $totp_uri )
->setSize( 220 )
->setMargin( 8 );
$qrCode = new \Endroid\QrCode\QrCode(
$totp_uri,
new \Endroid\QrCode\Encoding\Encoding( 'UTF-8' ),
\Endroid\QrCode\ErrorCorrectionLevel::Low,
220,
8
);
return ( new \Endroid\QrCode\Writer\PngWriter() )->write( $qrCode )->getDataUri();
}