From 1cf4c86646fc2349c305f233b3ccdecce1cfc979 Mon Sep 17 00:00:00 2001 From: nocci Date: Sun, 8 Mar 2026 11:30:08 +0000 Subject: [PATCH] fix(api): update Epic Games OAuth endpoints and response field names Update OAuth endpoints to new public service URLs and adapt to camelCase response fields in device authorization response. --- epic-claimer-new.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/epic-claimer-new.js b/epic-claimer-new.js index 8d81e14..84d9e0c 100644 --- a/epic-claimer-new.js +++ b/epic-claimer-new.js @@ -47,7 +47,7 @@ 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', @@ -98,8 +98,8 @@ const getValidAuth = async ({ otpKey, reuseCookies, cookiesPath }) => { let deviceResponse; try { - deviceResponse = await axios.post('https://api.epicgames.dev/epic/oauth/deviceCode', { - client_id: '34a02cf8f4414e29b159cdd02e6184bd', + deviceResponse = await axios.post('https://account-public-service-prod.ol.epicgames.com/account/api/oauth/deviceAuthorization', { + clientId: '34a02cf8f4414e29b159cdd02e6184bd', scope: 'account.basicprofile account.userentitlements', }); } catch (error) { @@ -107,11 +107,11 @@ const getValidAuth = async ({ otpKey, reuseCookies, cookiesPath }) => { return { bearerToken: null, cookies: [] }; } - const { device_code, user_code, verification_uri_complete } = deviceResponse.data; - console.log(`📱 Open: ${verification_uri_complete}`); - console.log(`💳 Code: ${user_code}`); + const { deviceCode, userCode, verificationUriComplete } = deviceResponse.data; + console.log(`📱 Open: ${verificationUriComplete}`); + console.log(`💳 Code: ${userCode}`); - const tokens = await pollForTokens(device_code); + const tokens = await pollForTokens(deviceCode); if (otpKey) { const totpCode = authenticator.generate(otpKey);