whatsapp/public/login.html

19 lines
504 B
HTML
Raw Normal View History

2025-05-06 08:51:13 +00:00
<!DOCTYPE html>
<html>
2025-05-06 09:54:23 +00:00
<head><title>Connexion WhatsApp</title></head>
2025-05-06 08:51:13 +00:00
<body>
2025-05-06 09:54:23 +00:00
<h1>Scanne le QR Code</h1>
<div id="qr">Chargement...</div>
2025-05-06 08:51:13 +00:00
<script>
2025-05-06 09:54:23 +00:00
async function refreshQR() {
2025-05-06 08:51:13 +00:00
const res = await fetch('/api/qrcode');
const data = await res.json();
2025-05-06 09:54:23 +00:00
if (data.connected) location.href = '/connected';
else if (data.qr) document.getElementById('qr').innerHTML = `<img src="${data.qr}" />`;
setTimeout(refreshQR, 3000);
2025-05-06 08:51:13 +00:00
}
2025-05-06 09:54:23 +00:00
refreshQR();
2025-05-06 08:51:13 +00:00
</script>
</body>
</html>