feat: logout client

close #255
This commit is contained in:
Pedro Lopez 2020-06-17 23:58:02 -04:00
commit 300b367fa0

View file

@ -359,6 +359,15 @@ class Client extends EventEmitter {
await this.pupBrowser.close();
}
/**
* Logs out the client, closing the current session
*/
async logout() {
return await this.pupPage.evaluate(() => {
return window.Store.AppState.logout();
});
}
/**
* Returns the version of WhatsApp Web currently being run
* @returns Promise<string>