refactor(auth): remove quotes from object keys and trailing commas in device auth flow
All checks were successful
build-and-push / lint (push) Successful in 8s
build-and-push / sonar (push) Successful in 20s
build-and-push / docker (push) Successful in 11s

This commit is contained in:
nocci 2026-03-08 12:35:54 +00:00
parent 52bd469976
commit bceb642bcb

View file

@ -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(), {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Basic OThmN2U0MmMyZTNhNGY4NmE3NGViNDNmYmI0MWVkMzk6MGEyNDQ5YTItMDEwYS00NTFlLWFmZWMtM2U4MTI5MDFjNGQ3',
Authorization: 'Basic OThmN2U0MmMyZTNhNGY4NmE3NGViNDNmYmI0MWVkMzk6MGEyNDQ5YTItMDEwYS00NTFlLWFmZWMtM2U4MTI5MDFjNGQ3',
},
});
if (response.data?.access_token) {
@ -110,7 +110,7 @@ const getClientCredentialsToken = async () => {
};
// Get device authorization code (second step of OAuth flow)
const getDeviceAuthorizationCode = async (clientCredentialsToken) => {
const getDeviceAuthorizationCode = async clientCredentialsToken => {
try {
const params = new URLSearchParams();
params.append('prompt', 'login');
@ -126,7 +126,7 @@ const getDeviceAuthorizationCode = async (clientCredentialsToken) => {
return {
deviceCode: response.data.device_code,
userCode: response.data.user_code,
verificationUriComplete: response.data.verification_uri_complete
verificationUriComplete: response.data.verification_uri_complete,
};
} catch (error) {
console.error('Failed to get device authorization code:', error.response?.status || error.message);