whatsapp/public/login.html

27 lines
633 B
HTML
Raw Normal View History

2025-05-06 08:51:13 +00:00
<!DOCTYPE html>
2025-05-06 10:12:55 +00:00
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Connexion WhatsApp</title>
</head>
2025-05-06 08:51:13 +00:00
<body>
2025-05-06 10:12:55 +00:00
<h1>Scanne le QR Code WhatsApp</h1>
<div id="qrcode">Chargement...</div>
2025-05-06 08:51:13 +00:00
<script>
2025-05-06 10:12:55 +00:00
async function checkQR() {
2025-05-06 08:51:13 +00:00
const res = await fetch('/api/qrcode');
const data = await res.json();
2025-05-06 10:12:55 +00:00
if (data.connected) {
document.getElementById('qrcode').innerHTML = '✅ Connecté à WhatsApp !';
} else if (data.qr) {
document.getElementById('qrcode').innerHTML = `<img src="${data.qr}" />`;
}
setTimeout(checkQR, 3000);
2025-05-06 08:51:13 +00:00
}
2025-05-06 10:12:55 +00:00
checkQR();
2025-05-06 08:51:13 +00:00
</script>
</body>
</html>