mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-19 03:59:16 +00:00
Added "restartOnAuthFail" as an option (#112)
- When true, the sessions passed is discarded when reinitialized.
This commit is contained in:
@@ -75,7 +75,11 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
this.emit(Events.AUTHENTICATION_FAILURE, 'Unable to log in. Are the session details valid?');
|
||||
browser.close();
|
||||
|
||||
if (this.options.restartOnAuthFail) {
|
||||
// session restore failed so try again but without session to force new authentication
|
||||
this.options.session = null;
|
||||
this.initialize(this.options);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user