Deploy to staging #10
|
|
@ -35,24 +35,6 @@ export class LangtonsApiBid extends ApiBid {
|
||||||
return !(await this.page_context.$('input[name="loginEmail"]')) && fs.existsSync(filePath);
|
return !(await this.page_context.$('input[name="loginEmail"]')) && fs.existsSync(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
async waitCodeLogin() {
|
|
||||||
if (!this.page_context) return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.page_context.waitForNavigation({ timeout: 15000, waitUntil: 'domcontentloaded' });
|
|
||||||
} catch (error) {
|
|
||||||
console.warn(`⚠️ [${this.id}] waitLogin timeout, reloading page...`);
|
|
||||||
|
|
||||||
await this.page_context.reload({ waitUntil: 'networkidle0' });
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.page_context.waitForNavigation({ timeout: 15000, waitUntil: 'domcontentloaded' });
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`❌ [${this.id}] Failed to navigate after reload:`, err.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async handleLogin() {
|
async handleLogin() {
|
||||||
const page = this.page_context;
|
const page = this.page_context;
|
||||||
|
|
||||||
|
|
@ -135,7 +117,6 @@ export class LangtonsApiBid extends ApiBid {
|
||||||
|
|
||||||
await page.goto(this.url, { waitUntil: 'networkidle2' });
|
await page.goto(this.url, { waitUntil: 'networkidle2' });
|
||||||
|
|
||||||
// await this.waitCodeLogin();
|
|
||||||
// 📂 Save session context to avoid re-login
|
// 📂 Save session context to avoid re-login
|
||||||
await this.saveContext();
|
await this.saveContext();
|
||||||
console.log(`✅ [${this.id}] Login successful!`);
|
console.log(`✅ [${this.id}] Login successful!`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue