Skip to content

Commit

Permalink
ue: login: fix #248, similar to #236
Browse files Browse the repository at this point in the history
Commits for #236:
d73a523
a374d48
  • Loading branch information
vogler committed Nov 9, 2023
1 parent 739fb0d commit a7cc68b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions unrealengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ try {

await page.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://graphql.unrealengine.com/ue/graphql'));

while (await page.locator('.display-name').count() == 0) {
while (await page.locator('unrealengine-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 All @@ -59,8 +59,9 @@ try {
const email = cfg.eg_email || await prompt({ message: 'Enter email' });
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.click('text=Sign in with Epic Games');
await page.fill('#email', email);
await page.click('button[type="submit"]');
await page.fill('#password', password);
await page.click('button[type="submit"]');
page.waitForSelector('#h_captcha_challenge_login_prod iframe').then(() => {
Expand Down Expand Up @@ -88,7 +89,7 @@ try {
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);
}
await page.waitForTimeout(1000);
user = await page.locator('.display-name').first().innerHTML();
user = await page.locator('unrealengine-navigation').getAttribute('displayname'); // 'null' if !isloggedin
console.log(`Signed in as ${user}`);
db.data[user] ||= {};

Expand Down

0 comments on commit a7cc68b

Please sign in to comment.