Auth Strategies (#1257)

* auth strategies

* default to no auth

* rename base auth strategy

* rename base strategy cont.

* refactor auth strategy methods and LocalAuth

* activate old session options even if is falsy value

* move restartOnAuthFail to LegacyAuthStrategy option

* add link to guide item

* update example/shell

* types
This commit is contained in:
Pedro S. Lopez 2022-02-27 22:02:49 -04:00 • committed by GitHub
commit f6de161c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 266 additions and 116 deletions

View file

@ -1,17 +1,10 @@
const { Client, Location, List, Buttons } = require('./index');
const { Client, Location, List, Buttons, LocalAuth } = require('./index');
const client = new Client({
clientId: 'example',
const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: { headless: false }
});
// You also could connect to an existing instance of a browser
// {
// puppeteer: {
// browserWSEndpoint: `ws://localhost:3000`
// }
// }
client.initialize();
client.on('qr', (qr) => {