Rhymen / go-whatsapp

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

Increase QR code timeout ttl? #581

Open deven96 opened 3 years ago

deven96 commented 3 years ago

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

danielspk commented 3 years ago

Hi @deven96.

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

This could help for issue #564

deven96 commented 3 years ago

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