Используйте этот код и дайте мне знать, если вы все еще сталкиваетесь с проблемой.
const isAuthenticated = () => {
return axios.get('https://myaddress/authenticate').then(response => {
// returning the data here allows the caller to get it through another .then(...)
return response.data
}).catch(error => console.log(error));
};
isAuthenticated().then(data => {
response.json({ message: 'Request received!', data })
})
Здесь такие же вопросы, как и у вас: Возвращение данных из Axios API ||Пожалуйста, проверьте это также.