function makeRequest(url, body) {
const token = getTokenFromCache();
token = getToken(clientId, clientSecret);
storeTokenInCache(token, days: 30);
const response = makeRequestToSquidex(url, body);
// Token has probably expired.
if (response.status == 401) {
// Request the token again.
token = getToken(clientId, clientSecret);
storeTokenInCache(token, days: 30);
// Try the request again.
response = makeRequestToSquidex(url, body);
// You can still have a 401 here, but this very likely not an epxired token then.