Now logout also close the shared browser

pull/8/head
MillenniumEarl 2020-10-08 21:19:54 +02:00
parent f9fa27f5b8
commit d2b9c98c8d
2 changed files with 8 additions and 2 deletions

View File

@ -296,7 +296,7 @@ module.exports.getUserData = async function () {
};
/**
* @public
* Logout from the current user.
* Logout from the current user and gracefully close shared browser.
* You **must** be logged in to the portal before calling this method.
*/
module.exports.logout = function () {
@ -305,6 +305,12 @@ module.exports.logout = function () {
return;
}
shared.isLogged = false;
// Gracefully close shared browser
if (!shared.isolation) {
_browser.close()
.then(() => _browser = null);
}
};
//#endregion