Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.05k stars 490 forks source link

#581: Increasing QR code timeout ttl #584

Open deven96 opened 3 years ago

AlmogBaku commented 2 years ago

The timeout of the QR is derived from the response. You can't just configure it as you wish :O

deven96 commented 2 years ago

The timeout of the QR is derived from the response. You can't just configure it as you wish :O

Oh really... the timeout may be more than 20 seconds specified in the response then because I've tried logging in after the 1 minute mark using the PR and it worked @AlmogBaku

AlmogBaku commented 2 years ago

Maybe it's still valid for a while after the TTL, but there is no way to ensure that. The best way to handle it is to refresh the QR code.

This is also the way Whatsapp web behave - refreshing the QR every 20 seconds

deven96 commented 2 years ago

Maybe it's still valid for a while after the TTL, but there is no way to ensure that. The best way to handle it is to refresh the QR code.

This is also the way Whatsapp web behave - refreshing the QR every 20 seconds

I see what you mean. To that regard, is there anyway to get that refresh without exiting the terminal. The project I intend to use this for doesn't ensure scan will happen after 20 seconds

AlmogBaku commented 2 years ago

You need to build it on your own. For production use-cases it's better to use a different "qr encoding" mechanism. I built mine with skip2/go-qrcode and gorilla/websocket