Open jesscarrasco opened 7 years ago
Hi @jesscarrasco, I am writing about redux-oauth, therefore I am not sure that solution will work for redux-auth but I assume it should.
You need to pass headers as options to fetch
and headers should be merged with auth headers by library.
fetch(URL, {
headers: {
customerHeader: 'value'
}
})
Another important part of the puzzle - your backend should support your custom headers, so you need to adjust your CORS configuration (which headers can be accepted and exposed) and probably nginx or whatever you use before your backend.
If redux-auth doesn't support merging custom headers this can be easily solved by small changes in library source code - check utils/fetch.js.
I am aware that I can use custom headers when using the fetch() function but I'd like to pass headers to the default API calls, for example when using email sign in. Is it possible?