0

I tried to do it as it says in the official documentation:

axios.defaults.headers.common["Authorization"] = authToken;

But if I make a request from a different function it comes out undefined

  • Show us your “other function” you have to be using the same axios instance that you set the defaults on. You cannot set the defaults on one instance and then, in your “other function” use a different instance – Adam Jenkins Jan 16 '22 at 00:01
  • @Adam and how can i set globally for all instances? – zAngelDEV Jan 16 '22 at 04:11

0 Answers0