@wppconnect-team/wppconnect
Version:
WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligen
19 lines (18 loc) • 542 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidSessionToken = isValidSessionToken;
/**
* Validate the object to check is a valid token
* @param token Token to validate
* @returns Token is valid
*/
function isValidSessionToken(token) {
const requiredAttribbutes = [
'WABrowserId',
'WASecretBundle',
'WAToken1',
'WAToken2',
];
return (token &&
requiredAttribbutes.every((attr) => typeof token[attr] === 'string' && token[attr].length > 0));
}