title: how to use axios to sign in with OAuth
body: <p>I just started learning MERN stack last week with Brad Traversy's MERN course: <a href="https://www.udemy.com/mern-stack-front-to-back/" rel="nofollow noreferrer">https://www.udemy.com/mern-stack-front-to-back/</a>
  In the course, he separated front-end and back-end and use back-end as REST API. In the back-end, he has a POST route (/api/auth) that returns a JWT token and the API is used in the react app axios. Then, the response is used for the value of the header x-auth-token, so that the authentication middleware could help to authenticate. As an computer science newbie working as an internship right now, I am required to make a web app for my company for internal use which uses slack OAuth for authentication. Now here is the problem: when I use axios, the response is some HTML codes like this:</p>
  
  <pre><code>GET https://slack.com/oauth/authorize? 
  scope=identity.basic,identity.email,identity.avatar&amp;client_id=48321353297.675712837139 in postman, result:
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en-US" class=""&gt;
      &lt;head&gt;
          &lt;script type="text/javascript"&gt;
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
      'gtm.start': Date.now(),
      'event' : 'gtm.js',
      'secure_page' : false,
  });
  var firstScript = document.getElementsByTagName('script')[0];
  var thisScript = document.createElement('script');
  thisScript.async = true;
  thisScript.src = '//www.googletagmanager.com/gtm.js?id=GTM-KH2LPK';
  firstScript.parentNode.insertBefore(thisScript, firstScript);
  &lt;/script&gt;
          &lt;script type="text/javascript"&gt;
  document.addEventListener("DOMContentLoaded", function(e) {
      var gtmDataLayer = window.dataLayer || [];
      var gtmTags = document.querySelectorAll('*[data-gtm-click]');
      var gtmClickHandler = function(c) {
          var gtm_events = this.getAttribute('data-gtm-click');
          if (!gtm_events) return;
          var gtm_events_arr = gtm_events.split(",");
          for(var e=0; e &lt; gtm_events_arr.length; e++) {
              var ev = gtm_events_arr[e].trim();
              gtmDataLayer.push({ 'event': ev });
          }
      };
      for(var g=0; g &lt; gtmTags.length; g++){
          var elem = gtmTags[g];
          elem.addEventListener('click', gtmClickHandler);
      }
  });
  
          &lt;/script&gt;
          &lt;script type="text/javascript"&gt;
  (function(e,c,b,f,d,g,a){e.SlackBeaconObject=d;
  e[d]=e[d]||function(){(e[d].q=e[d].q||[]).push([1*new Date(),arguments])};
  e[d].l=1*new Date();g=c.createElement(b);a=c.getElementsByTagName(b)[0];
  g.async=1;g.src=f;a.parentNode.insertBefore(g,a)
  })(window,document,"script","https://a.slack-edge.com/bv1-6-8cacda2/slack_beacon.bc058f2eca7b7d633d5a.min.js","sb");
  window.sb('set', 'token', '3307f436963e02d4f9eb85ce5159744c');
  sb('set', 'user_' + "batch", "signup_api");sb('set', 'user_' + "created", "2019-06-03");sb('set', 'user_id', "UK781P40Y");
  sb('set', 'name_tag', "wemine" + '/' + "klaus.chau");
  window.sb('track', 'pageview');
  &lt;/script&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;script type="text/javascript"&gt;window.location.href = "https:\/\/slack.com\/oauth\/authorize?scope=identity.basic,identity.email,identity.avatar&amp;client_id=48321353297.675712837139&amp;tracked=1";&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I think the problem is that it is sending me the 'confirm login page' instead of the jwt token I needed from the redirectURI.
  Would it be possible for me to implement like what Brad did in the course even though I am not logging in with password and email?
  Thanks
  Resources that could be referenced:
  <a href="https://github.com/bradtraversy/devconnector_2.0/blob/master/routes/api/auth.js" rel="nofollow noreferrer">https://github.com/bradtraversy/devconnector_2.0/blob/master/routes/api/auth.js</a>
  <a href="https://github.com/bradtraversy/devconnector_2.0/blob/master/client/src/actions/auth.js" rel="nofollow noreferrer">https://github.com/bradtraversy/devconnector_2.0/blob/master/client/src/actions/auth.js</a>
  <a href="https://github.com/bradtraversy/devconnector_2.0/blob/master/client/src/reducers/auth.js" rel="nofollow noreferrer">https://github.com/bradtraversy/devconnector_2.0/blob/master/client/src/reducers/auth.js</a></p>