go-whatsapp icon indicating copy to clipboard operation
go-whatsapp copied to clipboard

#581: Increasing QR code timeout ttl

Open deven96 opened this issue 3 years ago • 5 comments

deven96 avatar Jun 27 '21 14:06 deven96

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

AlmogBaku avatar Jul 16 '21 13:07 AlmogBaku

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

deven96 avatar Jul 16 '21 16:07 deven96

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

AlmogBaku avatar Jul 17 '21 21:07 AlmogBaku

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

deven96 avatar Jul 19 '21 07:07 deven96

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

AlmogBaku avatar Aug 03 '21 13:08 AlmogBaku