Hi, after some time coding on my express back-end, the /oath/token end-point suddenly stopped returning a valid response.
Expected behaviour is to receive a “data: { access_token, …}” property.
What I receive is “nonsense” characters: “data: c�@�lf��>��a���9!и鱺���’c��…”
This is the code for getting the token:
const getAuthToken = async (): Promise<string | null> => {
const options: AxiosRequestConfig = {
baseURL: DOMAIN,
url: '/oauth/token',
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: {
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
audience: AUDIENCE,
grant_type: 'client_credentials',
},
};
try {
const response = await axios(options);
console.log(response.data);
if (response.status === 200) return response.data.access_token;
return null;
} catch (err) {
console.log(err);
return null;
}
};
This worked beautifully until an hour ago, when it just stopped providing the expected response.
Thank you,
Martin