You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the wonderful plugin.
I am having issues with extending axios
This works a little bit
Upon getting a token (login)
I don't exactly know why my header is being stripped X-Tenant
data.tenant works
After bearer token is returned,
the next request to endpoints.user.url is converted to POST and data.tenant is attached since headers are being stripped.
After a page refresh,
axios call to user is not working since it is not being converted to post i don't know why it is not being extended.
it doesn't get called in $axios.onRequest
"@nuxtjs/auth-next": "^5.0.0-1621716493.b9b36c6",
axios.js
import { getSubdomain } from '~/assets/js/utils'
export default function ({ $axios, req }) {
$axios.onRequest((config) => {
if (!config.data) {
// Making it a post request to attach data.tenant since headers are magically stripped
config.method = 'post'
config.data = {}
}
config.data.tenant = getSubdomain(process.server ? req.headers.host : location.hostname)
config.headers.common['X-Tenant'] = getSubdomain(
process.server ? req.headers.host : location.hostname,
)
})
}
@bmulholland thank you for replying. I've written my own auth and didn't made use of nuxt/auth anymore as this was crucial for me. I can't verify if this is fixed at the moment.
Thank you for the wonderful plugin.
I am having issues with extending axios
This works a little bit
Upon getting a token (login)
I don't exactly know why my header is being stripped X-Tenant
data.tenant works
After bearer token is returned,
the next request to endpoints.user.url is converted to POST and data.tenant is attached since headers are being stripped.
After a page refresh,
axios call to user is not working since it is not being converted to post i don't know why it is not being extended.
it doesn't get called in $axios.onRequest
"@nuxtjs/auth-next": "^5.0.0-1621716493.b9b36c6",
axios.js
The text was updated successfully, but these errors were encountered: