From 1a34d8f0e4ad3d9ad2ddb06f6b00c742a6e8cced Mon Sep 17 00:00:00 2001 From: nocci Date: Wed, 31 Dec 2025 13:13:16 +0000 Subject: [PATCH] fix: force epic login page and autofill password when email prefilled --- epic-claimer-new.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epic-claimer-new.js b/epic-claimer-new.js index ff47640..ad3609e 100644 --- a/epic-claimer-new.js +++ b/epic-claimer-new.js @@ -124,14 +124,14 @@ const ensureLoggedIn = async (page, context) => { // Epic login form if (!cfg.eg_email || !cfg.eg_password) return false; try { - await page.waitForSelector('input[name="email"]', { timeout: cfg.login_visible_timeout }).catch(() => {}); + await page.goto('https://www.epicgames.com/id/login?lang=en-US&noHostRedirect=true&redirectUrl=' + URL_CLAIM, { waitUntil: 'domcontentloaded' }); const emailField = page.locator('input[name="email"], input#email'); const passwordField = page.locator('input[name="password"], input#password'); + // Some flows pre-fill email and show only password field if (await emailField.count()) await emailField.fill(cfg.eg_email); - if (await passwordField.count()) { - await passwordField.fill(cfg.eg_password); - await page.click('button[type="submit"]'); - } + await passwordField.waitFor({ timeout: cfg.login_visible_timeout }); + await passwordField.fill(cfg.eg_password); + await page.click('button[type="submit"]'); // MFA step try { await page.waitForURL('**/id/login/mfa**', { timeout: cfg.login_timeout });