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

Increase QR code timeout ttl?

Open deven96 opened this issue 3 years ago • 2 comments

The qr code has a ttl of 20 seconds and the login function throws a timeout err if the time has passed or any other request fails.

Is it possible to increase the ttl of the qr scan @Rhymen . From the code at session.go

Perhaps add a field to Options struct that will make that configurable


// conn.go
type Options struct {
	...
        QrTimeout      time.Duration
} 

// session.go
case <-time.After(wac.qrTimeout):
		return session, fmt.Errorf("qr code scan timed out")

I would be interested in implementing this if given the go ahead

deven96 avatar Jun 22 '21 16:06 deven96

Hi @deven96.

Do you have any idea what is the ttl that WhatsApp handles?

This could help for issue #564

danielspk avatar Jun 24 '21 13:06 danielspk

Hi @deven96.

Do you have any idea what is the ttl that WhatsApp handles?

This could help for issue #564

I'm not certain @danielspk, logging resp["ttl"] at that point would probably just give us 20 as specified

deven96 avatar Jun 25 '21 00:06 deven96