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.
This commit is contained in:
parent
e494c1c04e
commit
1455963346
2 changed files with 9 additions and 5 deletions
|
|
@ -14,3 +14,7 @@ services:
|
|||
environment:
|
||||
# - EMAIL=foo@bar.org
|
||||
# - NOTIFY='tgram://...'
|
||||
- EG_MODE=new
|
||||
|
||||
volumes:
|
||||
fgc:
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue