Skip to content

Commit dff712d

Browse files
committed
skip prompt for password if email is missing
1 parent 65a389c commit dff712d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

epic-games.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ try {
7272
if (cfg.eg_email && cfg.eg_password) console.info('Using email and password from environment.');
7373
else console.info('Press ESC to skip if you want to login in the browser.');
7474
const email = cfg.eg_email || await prompt({message: 'Enter email'});
75-
const password = cfg.eg_password || await prompt({type: 'password', message: 'Enter password'});
75+
const password = email && (cfg.eg_password || await prompt({type: 'password', message: 'Enter password'}));
7676
if (email && password) {
7777
await page.click('text=Sign in with Epic Games');
7878
await page.fill('#email', email);

gog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ try {
4444
if (cfg.gog_email && cfg.gog_password) console.info('Using email and password from environment.');
4545
else console.info('Press ESC to skip if you want to login in the browser (not possible in headless mode).');
4646
const email = cfg.gog_email || await prompt({message: 'Enter email'});
47-
const password = cfg.gog_password || await prompt({type: 'password', message: 'Enter password'});
47+
const password = email && (cfg.gog_password || await prompt({type: 'password', message: 'Enter password'}));
4848
if (email && password) {
4949
iframe.locator('a[href="/logout"]').click().catch(_ => { }); // Click 'Change account' (email from previous login is set in some cookie)
5050
await iframe.locator('#login_username').fill(email);

prime-gaming.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ try {
5050
if (cfg.pg_email && cfg.pg_password) console.info('Using email and password from environment.');
5151
else console.info('Press ESC to skip if you want to login in the browser (not possible in default headless mode).');
5252
const email = cfg.pg_email || await prompt({message: 'Enter email'});
53-
const password = cfg.pg_password || await prompt({type: 'password', message: 'Enter password'});
53+
const password = email && (cfg.pg_password || await prompt({type: 'password', message: 'Enter password'}));
5454
if (email && password) {
5555
await page.fill('[name=email]', email);
5656
await page.fill('[name=password]', password);

0 commit comments

Comments
 (0)