Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
method: 'POST',
proxy,
resolveWithFullResponse: true,
simple: false,
});
const { body } = res;
checkLoginStatus(res);
let wa;
let wctx;
let wresult;
try {
const elements = parse(body);
if (!elements || !elements.length || elements.length !== 1) {
throw new Error('Invalid login form!');
}
const { children } = elements[0];
children.forEach(child => {
if (child.name === 'input') {
const { name, value } = child.attribs;
if (/wa/i.test(name)) {
wa = value;
} else if (/wctx/i.test(name)) {
wctx = decodeHtmlEntity(value);
} else if (/wresult/i.test(name)) {
wresult = value;