cantierecreativo/redux-bees

add credentials:'include' to call

Closed this issue · 1 comments

Hello,

i am trying to get redux-bees work with a cookie authentication.
Until now it works in firefox only. I have found out, that I need to add the parameter credentials:'include' to the call. But adding it to the header parameters does not work, it needs to be outside of the header in the fetch call.
like so:

fetch('https://[ENDPOINT]', {
method: "GET",
...apiConfig,
credentials: 'include'
})

where can I slip this parameter into redux-bees so it will appear at the right position in the fetch call?

I found out, apart from configureHeaders there is also a method called configureOptions:

apiConfig = {
    baseUrl: config.baseUrl,
    configureHeaders(headers) {
      return {...headers};
   },
 configureOptions(options) {
      return {
        ...options,
        credentials:'include'
         };
    }
  };