Added "restartOnAuthFail" as an option (#112)
- When true, the sessions passed is discarded when reinitialized.
This commit is contained in:
parent
ec1a80dfb4
commit
d08b343815
1 changed files with 5 additions and 1 deletions
|
|
@ -75,7 +75,11 @@ class Client extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
this.emit(Events.AUTHENTICATION_FAILURE, 'Unable to log in. Are the session details valid?');
|
this.emit(Events.AUTHENTICATION_FAILURE, 'Unable to log in. Are the session details valid?');
|
||||||
browser.close();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue