redirect after a fetch post call
<p>I am creating an social login page with an Access Management (AM) server.
When user click on the login button then I make a fetch http post call to AM server. AM server generates a HTTP 301 redirect response with auth cookies to the social login page. I need to follow somehow this redirect response and show the new content in the web browser.</p>

<p>UI: ReactJS</p>

<p>Request:</p>

<pre><code>POST /api/auth/socialauth/initiate HTTP/1.1
Host    example.com
User-Agent  Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0)
Accept  */*
Accept-Language en-US,en;q=0.5
Accept-Encoding gzip, deflate
origin  http://web.example.com:8080
Referer http://web.example.com:8080/myapp/login
Cookie  authId=...; NTID=...
</code></pre>

<p>Response</p>

<pre><code>HTTP/1.1 307 Temporary Redirect
https://www.facebook.com/dialog/oauth?client_id=...&amp;scope=public_profile%2Cemail&amp;redirect_uri=http%3A%2F%2Fam.example.com%3A8083%2Fopenam%2Foauth2c%2FOAuthProxy.jsp&amp;response_type=code&amp;state=qtrwtidnwdpbft4ctj2e9mv3mjkifqo
</code></pre>

<p>React code:</p>

<pre><code>initiateSocialLogin() {
    var url = "/api/auth/socialauth/initiate";

    fetch(url, { method: 'POST' })
        .then(response =&gt; {
            // HTTP 301 response
            // HOW CAN I FOLLOW THE HTTP REDIRECT RESPONSE?
        })
        .catch(function(err) {
            console.info(err + " url: " + url);
        });
}
</code></pre>

<p>How I can follow the redirect response and show the new content in the web browser?</p>