feat(auth): add client_secret to Epic Games OAuth requests
This commit is contained in:
parent
1455963346
commit
e8c28db63d
1 changed files with 6 additions and 3 deletions
|
|
@ -50,7 +50,8 @@ const pollForTokens = async (deviceCode, maxAttempts = 30) => {
|
|||
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: '875a3b57d3a640a6b7f9b4e883463ab4',
|
||||
client_id: '98f7e42c2e3a4f86a74eb43fbb41ed39',
|
||||
client_secret: '0a2449a2-001a-451e-afec-3e812901c4d7',
|
||||
});
|
||||
if (response.data?.access_token) {
|
||||
console.log('✅ OAuth successful');
|
||||
|
|
@ -99,7 +100,8 @@ const getValidAuth = async ({ otpKey, reuseCookies, cookiesPath }) => {
|
|||
|
||||
try {
|
||||
const params = new URLSearchParams();
|
||||
params.append('clientId', '875a3b57d3a640a6b7f9b4e883463ab4');
|
||||
params.append('clientId', '98f7e42c2e3a4f86a74eb43fbb41ed39');
|
||||
params.append('clientSecret', '0a2449a2-001a-451e-afec-3e812901c4d7');
|
||||
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(), {
|
||||
|
|
@ -125,7 +127,8 @@ const getValidAuth = async ({ otpKey, reuseCookies, cookiesPath }) => {
|
|||
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,
|
||||
client_id: '875a3b57d3a640a6b7f9b4e883463ab4',
|
||||
client_id: '98f7e42c2e3a4f86a74eb43fbb41ed39',
|
||||
client_secret: '0a2449a2-001a-451e-afec-3e812901c4d7',
|
||||
});
|
||||
tokens.access_token = refreshed.data.access_token;
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue