From 1455963346e65dc4cd59cca0c0ce8fe5faf5cdc0 Mon Sep 17 00:00:00 2001 From: nocci Date: Sun, 8 Mar 2026 11:52:54 +0000 Subject: [PATCH] fix(api): update Epic Games OAuth endpoints and client ID The changes replace old API endpoints with current Epic Games' Public Account Service URLs and update the client ID across all OAuth requests (device authorization, token exchange, and refresh). This resolves authentication failures caused by deprecated endpoints and credentials. --- docker-compose.yml | 4 ++++ epic-claimer-new.js | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 50e099b..f8d797b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,3 +14,7 @@ services: environment: # - EMAIL=foo@bar.org # - NOTIFY='tgram://...' + - EG_MODE=new + +volumes: + fgc: diff --git a/epic-claimer-new.js b/epic-claimer-new.js index 2f3349d..a585721 100644 --- a/epic-claimer-new.js +++ b/epic-claimer-new.js @@ -47,10 +47,10 @@ const fetchFreeGamesAPI = async () => { const pollForTokens = async (deviceCode, maxAttempts = 30) => { for (let i = 0; i < maxAttempts; i++) { try { - const response = await axios.post('https://api.epicgames.dev/epic/oauth/token', { + const response = await axios.post('https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token', { grant_type: 'urn:ietf:params:oauth:grant-type:device_code', device_code: deviceCode, - client_id: '34a02cf8f4414e29b159cdd02e6184bd', + client_id: '875a3b57d3a640a6b7f9b4e883463ab4', }); if (response.data?.access_token) { console.log('✅ OAuth successful'); @@ -99,7 +99,7 @@ const getValidAuth = async ({ otpKey, reuseCookies, cookiesPath }) => { try { const params = new URLSearchParams(); - params.append('clientId', '34a02cf8f4414e29b159cdd02e6184bd'); + params.append('clientId', '875a3b57d3a640a6b7f9b4e883463ab4'); params.append('scope', 'account.basicprofile account.userentitlements'); deviceResponse = await axios.post('https://account-public-service-prod.ol.epicgames.com/account/api/oauth/deviceAuthorization', params.toString(), { @@ -122,10 +122,10 @@ const getValidAuth = async ({ otpKey, reuseCookies, cookiesPath }) => { const totpCode = authenticator.generate(otpKey); console.log(`🔑 TOTP Code (generated): ${totpCode}`); try { - const refreshed = await axios.post('https://api.epicgames.dev/epic/oauth/token', { + const refreshed = await axios.post('https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token', { grant_type: 'refresh_token', refresh_token: tokens.refresh_token, - code_verifier: totpCode, + client_id: '875a3b57d3a640a6b7f9b4e883463ab4', }); tokens.access_token = refreshed.data.access_token; } catch {