Skip to content

Commit

Permalink
Always set access token as bearer token
Browse files Browse the repository at this point in the history
  • Loading branch information
claabs committed Feb 22, 2025
1 parent 456b555 commit cbdbb52
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/puppet/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ export default class PuppetBase {
this.L.debug('Setting auth from bearer token cookies');
const userCookies = await getCookiesRaw(this.email);
puppeteerCookies = toughCookieFileStoreToPuppeteerCookie(userCookies);
} else {
const deviceAuth = getAccountAuth(this.email);
if (!deviceAuth) throw new Error(`Unable to get auth for user ${this.email}`);
}
const deviceAuth = getAccountAuth(this.email);
if (deviceAuth) {
this.L.debug({ deviceAuth }, 'Setting auth from device auth');
const bearerCookies: Cookie[] = [
'.epicgames.com',
Expand All @@ -126,6 +126,8 @@ export default class PuppetBase {
};
});
puppeteerCookies.push(...bearerCookies);
} else {
this.L.warn('No device auth found, auth issues may occur');
}
this.L.debug('Logging in with puppeteer');
this.page = await safeNewPage(this.browser, this.L);
Expand Down

0 comments on commit cbdbb52

Please sign in to comment.