title: Why is 'axios.get' returning a promise object?
body: <p>I've been trying to use <a href="https://github.com/mzabriskie/axios" rel="nofollow noreferrer">Axios</a> in order to check whether or not a user is authenticated server side (Node+Express+Passport).</p>
  
  <p>If a user is authenticated, the server sends back a "Connected" string, else, it sends back a "Not connected" string.</p>
  
  <pre><code>Router.get('/isAuth', function (req, res, next) {
      if (req.isAuthenticated()) {
          return res.status(200).send('Connected');
      } else {
          return res.status(200).send('Not connected');
      }
  });
  </code></pre>
  
  <p>I wrote a simple function to check the server's response:</p>
  
  <pre><code>function isAuth() {
    return axios.get('http://localhost:3000/endpoints/isAuth')
    .then((response) =&gt; {
      if (response.data === "Connected") {
        return true;
      } else {
        return false;
      }
    })
    .catch((error) =&gt; {
      console.log(error)
    })
  }
  </code></pre>
  
  <p>The function is supposed to return true if the user is connected, and vice-versa.</p>
  
  <p>Now, when I try to log the the function's results in the console, this is what I get:</p>
  
  <pre><code>Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
    __proto__ : Promise
    [[PromiseStatus]] : "resolved"
    [[PromiseValue]] : false
  </code></pre>
  
  <p>As you can see, the value returned is a promise object, whereas the desired output would preferably be a "True" or "False".</p>