diff --git a/src/AuthTotp.php b/src/AuthTotp.php index 8656ed0..5c90510 100644 --- a/src/AuthTotp.php +++ b/src/AuthTotp.php @@ -20,6 +20,12 @@ final class AuthTotp { } public static function qrImageUrl(string $otpauthUri, int $size = 200): string { + if (class_exists('QrBrandedRenderer', false)) { + $dataUri = QrBrandedRenderer::dataUri($otpauthUri, $size); + if ($dataUri !== null) { + return $dataUri; + } + } return 'https://api.qrserver.com/v1/create-qr-code/?size=' . $size . 'x' . $size . '&data=' . rawurlencode($otpauthUri); }