fix: check remember-me and handle split email/password epic login

This commit is contained in:
nocci 2025-12-31 13:27:59 +00:00
parent f5e404329f
commit 943fdbbf0c

View file

@ -127,11 +127,21 @@ const ensureLoggedIn = async (page, context) => {
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);
const continueBtn = page.locator('button:has-text("Continue"), button[type="submit"]');
// step 1: email + continue
if (await emailField.count()) {
await emailField.fill(cfg.eg_email);
await continueBtn.first().click();
}
// step 2: password + submit
await passwordField.waitFor({ timeout: cfg.login_visible_timeout });
await passwordField.fill(cfg.eg_password);
const rememberMe = page.locator('input[name="rememberMe"], #rememberMe');
if (await rememberMe.count()) await rememberMe.check().catch(() => {});
await page.click('button[type="submit"]');
// MFA step
try {
await page.waitForURL('**/id/login/mfa**', { timeout: cfg.login_timeout });