you need to request the backend to obtain the token, using the interceptor to bring the token by default.
instance.interceptors.request.use(function (config) {
//config
getToken()
.then((data) => {
config.headers.Authorization = data;
})
return config;
console.log(config)
});
The getToken function puts token, back through promise, but return does not go out. How should token be set