fix: force epic login page and autofill password when email prefilled
This commit is contained in:
parent
5c7a945be0
commit
1a34d8f0e4
1 changed files with 5 additions and 5 deletions
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue