Skip to content

Commit

Permalink
eg: fix sign in, user displayname, #236
Browse files Browse the repository at this point in the history
  • Loading branch information
vogler committed Oct 25, 2023
1 parent 0478790 commit d73a523
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions epic-games.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ try {

// page.click('button:has-text("Accept All Cookies")').catch(_ => { }); // Not needed anymore since we set the cookie above. Clicking this did not always work since the message was animated in too slowly.

while (await page.locator('a[role="button"]:has-text("Sign In")').count() > 0) {
while (await page.locator('egs-navigation').getAttribute('isloggedin') != 'true') {
console.error('Not signed in anymore. Please login in the browser or here in the terminal.');
if (cfg.novnc_port) console.info(`Open http://localhost:${cfg.novnc_port} to login inside the docker container.`);
if (!cfg.debug) context.setDefaultTimeout(cfg.login_timeout); // give user some extra time to log in
Expand Down Expand Up @@ -114,7 +114,7 @@ try {
await page.waitForURL(URL_CLAIM);
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
}
user = await page.locator('#user span').first().innerHTML();
user = await page.locator('egs-navigation').getAttribute('displayname'); // 'null' if !isloggedin
console.log(`Signed in as ${user}`);
db.data[user] ||= {};
if (cfg.time) console.timeEnd('login');
Expand Down

0 comments on commit d73a523

Please sign in to comment.