Skip to content

Commit

Permalink
Added "restartOnAuthFail" as an option (#112)
Browse files Browse the repository at this point in the history
- When true, the sessions passed is discarded when reinitialized.
  • Loading branch information
stevefold committed Mar 22, 2020
1 parent ec1a80d commit d08b343
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Client.js
Expand Up @@ -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;
}

Expand Down

0 comments on commit d08b343

Please sign in to comment.