Fix QR data handling in WhatsApp auth (#467)

Running WhatsApp setup fails because the string interpolation of `qrData` does not inject quotes.
This commit is contained in:
Will Monk
2026-02-24 15:32:54 -06:00
committed by GitHub
parent 52984491b6
commit 18c0432db4

View File

@@ -210,7 +210,7 @@ async function handleQrBrowser(
const qrData = fs.readFileSync(qrFile, 'utf-8');
try {
const svg = execSync(
`node -e "const QR=require('qrcode');const data=${JSON.stringify(qrData)};QR.toString(data,{type:'svg'},(e,s)=>{if(e)process.exit(1);process.stdout.write(s)})"`,
`node -e "const QR=require('qrcode');const data='${qrData}';QR.toString(data,{type:'svg'},(e,s)=>{if(e)process.exit(1);process.stdout.write(s)})"`,
{ cwd: projectRoot, encoding: 'utf-8' },
);
const html = QR_AUTH_TEMPLATE.replace('{{QR_SVG}}', svg);