mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 11:39:14 +00:00
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:
24
src/authStrategies/BaseAuthStrategy.js
Normal file
24
src/authStrategies/BaseAuthStrategy.js
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Base class which all authentication strategies extend
|
||||
*/
|
||||
class BaseAuthStrategy {
|
||||
constructor() {}
|
||||
setup(client) {
|
||||
this.client = client;
|
||||
}
|
||||
async beforeBrowserInitialized() {}
|
||||
async afterBrowserInitialized() {}
|
||||
async onAuthenticationNeeded() {
|
||||
return {
|
||||
failed: false,
|
||||
restart: false,
|
||||
failureEventPayload: undefined
|
||||
};
|
||||
}
|
||||
async getAuthEventPayload() {}
|
||||
async logout() {}
|
||||
}
|
||||
|
||||
module.exports = BaseAuthStrategy;
|
||||
Reference in New Issue
Block a user