some fixes
This commit is contained in:
@ -32,8 +32,8 @@ export async function pullData(amount = 100) {
|
|||||||
needCode = false;
|
needCode = false;
|
||||||
state.push('Starting Browser');
|
state.push('Starting Browser');
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
args: ['--no-sandbox']
|
args: ['--no-sandbox'],
|
||||||
//headless: false
|
headless: true
|
||||||
//defaultViewport: null,
|
//defaultViewport: null,
|
||||||
//args: ['--disable-blink-features=PrettyPrintJSONDocument']
|
//args: ['--disable-blink-features=PrettyPrintJSONDocument']
|
||||||
});
|
});
|
||||||
@ -98,10 +98,14 @@ export async function pullData(amount = 100) {
|
|||||||
if (url.includes('mfa/targets')) {
|
if (url.includes('mfa/targets')) {
|
||||||
state.push('MFA required, selecting SMS option');
|
state.push('MFA required, selecting SMS option');
|
||||||
console.log('MFA required, please complete the authentication process.');
|
console.log('MFA required, please complete the authentication process.');
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, Math.random() * 5000));
|
||||||
|
|
||||||
await page.locator('aria/SMS: (XXX) XXX-4029').click();
|
await page.locator('aria/SMS: (XXX) XXX-4029').click();
|
||||||
await page.waitForNavigation();
|
await page.waitForNavigation();
|
||||||
//need to do some stuff ehre
|
//need to do some stuff ehre
|
||||||
await page.keyboard.press('Tab');
|
await new Promise((resolve) => setTimeout(resolve, Math.random() * 5000));
|
||||||
|
|
||||||
|
//await page.keyboard.press('Tab');
|
||||||
state.push('Waiting for code input');
|
state.push('Waiting for code input');
|
||||||
needCode = true;
|
needCode = true;
|
||||||
for (let i = 0; i < 5 * 60; i++) {
|
for (let i = 0; i < 5 * 60; i++) {
|
||||||
@ -115,7 +119,8 @@ export async function pullData(amount = 100) {
|
|||||||
}
|
}
|
||||||
state.push(`Got code: ${code}`);
|
state.push(`Got code: ${code}`);
|
||||||
|
|
||||||
await page.keyboard.type(code);
|
await page.locator('>>> [placeholder="Secure Access Code"]').fill(code);
|
||||||
|
//await page.keyboard.type(code);
|
||||||
code = null;
|
code = null;
|
||||||
needCode = false;
|
needCode = false;
|
||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
@ -137,6 +142,8 @@ export async function pullData(amount = 100) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//await new Promise((resolve) => setTimeout(resolve, 60000));
|
||||||
|
|
||||||
state.push('Fetching q2token');
|
state.push('Fetching q2token');
|
||||||
const q2token = (await browser.cookies()).find((cookie) => cookie.name === 'q2token')?.value;
|
const q2token = (await browser.cookies()).find((cookie) => cookie.name === 'q2token')?.value;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user