const GNRequest = async (credentials) => {
const authResponse = await authenticate(credentials);
const accessToken = authResponse.data?.access_token;
setTimeout(async () => {
GNRequest(credentials);
console.log(accessToken);
}, 3600000);
return axios.create({
baseURL: process.env.GN_ENDPOINT,
httpsAgent: agent,
headers: {
Authorization: Bearer ${accessToken},
"Content-Type": "application/json",
},
});
};