Closed luizcastrolfc closed 6 years ago
I think a middleware could do the trick:
let requestWithCredentialsMiddleware = {
name: 'with-credentials',
req: (payload) => {
payload.withCredentials = true
return payload
}
}
And use it here:
jsonApiInstance.insertMiddlewareBefore('axios-request', requestWithCredentialsMiddleware)
Or maybe setting defaults would be a simpler solution:
jsonApiInstance.axios.defaults.withCredentials = true
I haven't tried either of these. Please report your findings.
Just to report feedback.
jsonApiInstance.axios.defaults.withCredentials = true
works perfectly.
Is there a way to set
withCredentials = true
? axios example:const api = axios.create({ withCredentials: true, ... })