Fix Auth Timeout Error (#5666)

* Fix Auth Timeout Error

* fixing Auth Timeout Error
This commit is contained in:
BenyFilho 2025-12-15 05:41:15 -03:00 • committed by GitHub
commit 143662eae2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,8 +96,7 @@ class Client extends EventEmitter {
* Private function
*/
async inject() {
if(this.options.authTimeoutMs === undefined){
if(this.options.authTimeoutMs === undefined || this.options.authTimeoutMs==0){
this.options.authTimeoutMs = 30000;
}
let start = Date.now();
@ -110,8 +109,7 @@ class Client extends EventEmitter {
}
if(!res){
throw 'auth timeout';
}
}
await this.setDeviceName(this.options.deviceName, this.options.browserName);
const pairWithPhoneNumber = this.options.pairWithPhoneNumber;
const version = await this.getWWebVersion();