refactor(auth): remove quotes from object keys and trailing commas in device auth flow
This commit is contained in:
parent
52bd469976
commit
bceb642bcb
1 changed files with 3 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ const pollForTokens = async (deviceCode, maxAttempts = 30) => {
|
||||||
const response = await axios.post('https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token', params.toString(), {
|
const response = await axios.post('https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token', params.toString(), {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
'Authorization': 'Basic OThmN2U0MmMyZTNhNGY4NmE3NGViNDNmYmI0MWVkMzk6MGEyNDQ5YTItMDEwYS00NTFlLWFmZWMtM2U4MTI5MDFjNGQ3',
|
Authorization: 'Basic OThmN2U0MmMyZTNhNGY4NmE3NGViNDNmYmI0MWVkMzk6MGEyNDQ5YTItMDEwYS00NTFlLWFmZWMtM2U4MTI5MDFjNGQ3',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (response.data?.access_token) {
|
if (response.data?.access_token) {
|
||||||
|
|
@ -110,7 +110,7 @@ const getClientCredentialsToken = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get device authorization code (second step of OAuth flow)
|
// Get device authorization code (second step of OAuth flow)
|
||||||
const getDeviceAuthorizationCode = async (clientCredentialsToken) => {
|
const getDeviceAuthorizationCode = async clientCredentialsToken => {
|
||||||
try {
|
try {
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
params.append('prompt', 'login');
|
params.append('prompt', 'login');
|
||||||
|
|
@ -126,7 +126,7 @@ const getDeviceAuthorizationCode = async (clientCredentialsToken) => {
|
||||||
return {
|
return {
|
||||||
deviceCode: response.data.device_code,
|
deviceCode: response.data.device_code,
|
||||||
userCode: response.data.user_code,
|
userCode: response.data.user_code,
|
||||||
verificationUriComplete: response.data.verification_uri_complete
|
verificationUriComplete: response.data.verification_uri_complete,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to get device authorization code:', error.response?.status || error.message);
|
console.error('Failed to get device authorization code:', error.response?.status || error.message);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue