I am currently struggling with Nuxt's Axios module: https://axios.nuxtjs.org/. I would like to get some data from a specific endpoint where I have to use Basic Authentication.
Normally, with Axios, I would do something like:
await axios.get(
'http://endpoint',
{},
{
withCredentials: true,
auth: {
username: 'userame',
password: 'pw'
}
}
)
Unfortunately, with Nuxt's Axios module, it seems it is not that easy... I tried something like:
const data = await this.$axios.$get(
'http://endpoint',
{},
{
credentials: true,
auth: {
username: 'user',
password: 'pw'
}
}
)
But that leaves me with a 401 Unauthorized...
What am I missing here?