
| Current Path : /var/www/html/sirius-pallets/web/core/tests/Drupal/Nightwatch/Commands/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/sirius-pallets/web/core/tests/Drupal/Nightwatch/Commands/drupalUserIsLoggedIn.js |
/**
* Checks if a user is logged in.
*
* @param {function} callback
* A callback which will be called, when the login status has been checked.
* @return {object}
* The drupalUserIsLoggedIn command.
*/
exports.command = function drupalUserIsLoggedIn(callback) {
if (typeof callback === 'function') {
this.getCookies((cookies) => {
const sessionExists = cookies.value.some((cookie) =>
cookie.name.match(/^S?SESS/),
);
callback.call(this, sessionExists);
});
}
return this;
};