refactor(style): align template literals and whitespace formatting
- standardize string literals to single quotes in constants.js - remove unused variable and normalize whitespace in cookie.js - simplify nullish coalescing expression in device-auths.js This consistency improvement enhances code readability and enforces uniform style across the codebase.
This commit is contained in:
parent
22c84a759b
commit
c0d148dc8e
3 changed files with 10 additions and 11 deletions
|
|
@ -27,8 +27,8 @@ export const MFA_LOGIN_ENDPOINT = 'https://www.epicgames.com/id/api/login/mfa';
|
||||||
export const UNREAL_SET_SID_ENDPOINT = 'https://www.unrealengine.com/id/api/set-sid';
|
export const UNREAL_SET_SID_ENDPOINT = 'https://www.unrealengine.com/id/api/set-sid';
|
||||||
export const TWINMOTION_SET_SID_ENDPOINT = 'https://www.twinmotion.com/id/api/set-sid';
|
export const TWINMOTION_SET_SID_ENDPOINT = 'https://www.twinmotion.com/id/api/set-sid';
|
||||||
export const CLIENT_REDIRECT_ENDPOINT = `https://www.epicgames.com/id/api/client/${EPIC_CLIENT_ID}`;
|
export const CLIENT_REDIRECT_ENDPOINT = `https://www.epicgames.com/id/api/client/${EPIC_CLIENT_ID}`;
|
||||||
export const AUTHENTICATE_ENDPOINT = `https://www.epicgames.com/id/api/authenticate`;
|
export const AUTHENTICATE_ENDPOINT = 'https://www.epicgames.com/id/api/authenticate';
|
||||||
export const LOCATION_ENDPOINT = `https://www.epicgames.com/id/api/location`;
|
export const LOCATION_ENDPOINT = 'https://www.epicgames.com/id/api/location';
|
||||||
export const PHASER_F_ENDPOINT = 'https://talon-service-prod.ak.epicgames.com/v1/phaser/f';
|
export const PHASER_F_ENDPOINT = 'https://talon-service-prod.ak.epicgames.com/v1/phaser/f';
|
||||||
export const PHASER_BATCH_ENDPOINT = 'https://talon-service-prod.ak.epicgames.com/v1/phaser/batch';
|
export const PHASER_BATCH_ENDPOINT = 'https://talon-service-prod.ak.epicgames.com/v1/phaser/batch';
|
||||||
export const TALON_IP_ENDPOINT = 'https://talon-service-v4-prod.ak.epicgames.com/v1/init/ip';
|
export const TALON_IP_ENDPOINT = 'https://talon-service-v4-prod.ak.epicgames.com/v1/init/ip';
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ function getCookieJar(username) {
|
||||||
if (cookieJar) {
|
if (cookieJar) {
|
||||||
return cookieJar;
|
return cookieJar;
|
||||||
}
|
}
|
||||||
const cookieFilename = getCookiePath(username);
|
|
||||||
cookieJar = new tough.CookieJar();
|
cookieJar = new tough.CookieJar();
|
||||||
cookieJars.set(username, cookieJar);
|
cookieJars.set(username, cookieJar);
|
||||||
return cookieJar;
|
return cookieJar;
|
||||||
|
|
@ -42,7 +41,7 @@ function getCookieJar(username) {
|
||||||
export function editThisCookieToToughCookieFileStore(etc) {
|
export function editThisCookieToToughCookieFileStore(etc) {
|
||||||
const tcfs = {};
|
const tcfs = {};
|
||||||
|
|
||||||
etc.forEach((etcCookie) => {
|
etc.forEach(etcCookie => {
|
||||||
const domain = etcCookie.domain.replace(/^\./, '');
|
const domain = etcCookie.domain.replace(/^\./, '');
|
||||||
const expires = etcCookie.expirationDate
|
const expires = etcCookie.expirationDate
|
||||||
? new Date(etcCookie.expirationDate * 1000).toISOString()
|
? new Date(etcCookie.expirationDate * 1000).toISOString()
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export async function writeDeviceAuths(deviceAuths) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setAccountAuth(account, accountAuth) {
|
export async function setAccountAuth(account, accountAuth) {
|
||||||
const existingDeviceAuths = (await getDeviceAuths()) ?? {};
|
const existingDeviceAuths = await getDeviceAuths() ?? {};
|
||||||
existingDeviceAuths[account] = accountAuth;
|
existingDeviceAuths[account] = accountAuth;
|
||||||
await writeDeviceAuths(existingDeviceAuths);
|
await writeDeviceAuths(existingDeviceAuths);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue