Answer the question
In order to leave comments, you need to log in
How to save user parameters with http basic auth?
I authorize on a remote api, basic auth is configured. Authorization method:
auth() {
const token = Buffer.from(`${email}:${psw}`, 'utf8').toString('base64')
var config = {
method: "get",
url:
"http://....",
headers: {
Authorization: `Basic ${token}`,
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
},
Answer the question
In order to leave comments, you need to log in
but to access the same route or another, you need to pass the authorization header again
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question