<p dir="auto">What do you think about returning promises from transforms? I have a case where I need to perform some async operation in a transform.</p>
<p dir="auto">I'm trying to replicate a working auth request with axios (currently implemented using reqwest). I've read through <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="121216920" data-permission-text="Title is private" data-url="https://github.com/axios/axios/issues/167" data-hovercard-type="pull_request" data-hovercard-url="/axios/axios/pull/167/hovercard" href="https://github.com/axios/axios/pull/167">#167</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="98686828" data-permission-text="Title is private" data-url="https://github.com/axios/axios/issues/97" data-hovercard-type="issue" data-hovercard-url="/axios/axios/issues/97/hovercard" href="https://github.com/axios/axios/issues/97">#97</a> and have gotten close, but still not quite there.</p>
<p dir="auto"><a href="https://gist.github.com/jabacchetta/542314feb01b5fe89447bba22172f9c5">Here's a working example using reqwest</a>.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/12591890/20076041/69c2203e-a4fc-11e6-8528-aa7063a778d7.jpg"><img src="https://cloud.githubusercontent.com/assets/12591890/20076041/69c2203e-a4fc-11e6-8528-aa7063a778d7.jpg" alt="reqwest" style="max-width: 100%;"></a></p>
<p dir="auto">I tried duplicating the request exactly (according to the network tab) using axios, and <a href="https://gist.github.com/jabacchetta/899586e603764b0c0425552ccb18a0bc">this is what I came up with</a> (using a suggested transform workaround from one of the threads above):</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/12591890/20076159/f614b632-a4fc-11e6-94df-285a5996f53d.jpg"><img src="https://cloud.githubusercontent.com/assets/12591890/20076159/f614b632-a4fc-11e6-94df-285a5996f53d.jpg" alt="transform" style="max-width: 100%;"></a></p>
<p dir="auto">From the network tab, this solution appears to have worked for the request being manipulated, but the next Redux action (loadCurrentUser) that gets dispatched from that .then success fails, giving me the following error (which I did not get with the original reqwest solution):</p>
<blockquote>
<p dir="auto">No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:3000" rel="nofollow">http://localhost:3000</a>' is therefore not allowed access. The response had HTTP status code 401.</p>
</blockquote>
<p dir="auto">I also tried <a href="https://gist.github.com/jabacchetta/ce5e0f87d88a5d0ea0584c406e9cad0b">using params in the config</a> and received the exact same error.</p>
<p dir="auto">What am I doing wrong here?</p>