diff --git a/epic-games.js b/epic-games.js index e08bf68..710d574 100644 --- a/epic-games.js +++ b/epic-games.js @@ -72,7 +72,7 @@ try { if (cfg.eg_email && cfg.eg_password) console.info('Using email and password from environment.'); else console.info('Press ESC to skip if you want to login in the browser.'); const email = cfg.eg_email || await prompt({message: 'Enter email'}); - const password = cfg.eg_password || await prompt({type: 'password', message: 'Enter password'}); + const password = email && (cfg.eg_password || await prompt({type: 'password', message: 'Enter password'})); if (email && password) { await page.click('text=Sign in with Epic Games'); await page.fill('#email', email); diff --git a/gog.js b/gog.js index 02dc68f..edecd5f 100644 --- a/gog.js +++ b/gog.js @@ -44,7 +44,7 @@ try { if (cfg.gog_email && cfg.gog_password) console.info('Using email and password from environment.'); else console.info('Press ESC to skip if you want to login in the browser (not possible in headless mode).'); const email = cfg.gog_email || await prompt({message: 'Enter email'}); - const password = cfg.gog_password || await prompt({type: 'password', message: 'Enter password'}); + const password = email && (cfg.gog_password || await prompt({type: 'password', message: 'Enter password'})); if (email && password) { iframe.locator('a[href="/logout"]').click().catch(_ => { }); // Click 'Change account' (email from previous login is set in some cookie) await iframe.locator('#login_username').fill(email); diff --git a/prime-gaming.js b/prime-gaming.js index c340014..d276a72 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -50,7 +50,7 @@ try { if (cfg.pg_email && cfg.pg_password) console.info('Using email and password from environment.'); else console.info('Press ESC to skip if you want to login in the browser (not possible in default headless mode).'); const email = cfg.pg_email || await prompt({message: 'Enter email'}); - const password = cfg.pg_password || await prompt({type: 'password', message: 'Enter password'}); + const password = email && (cfg.pg_password || await prompt({type: 'password', message: 'Enter password'})); if (email && password) { await page.fill('[name=email]', email); await page.fill('[name=password]', password);