title: CORS preflight error redux & loopback API
body: <p>I have a client application on <code>react-redux</code> &amp; API app on <code>loopback</code>.</p>
  
  <p>For my local testing I am running client app on port 8080 and server app on port 3000.</p>
  
  <p>When I try to test out the Google OAuth (using <code>loopback-passport component</code>) with the client app, I am getting the below error. </p>
  
  <p><a href="https://i.stack.imgur.com/QTO1C.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QTO1C.png" alt="enter image description here"></a> </p>
  
  <p>When I test it using POSTMAN, there are no issues.</p>
  
  <p>Here is the client side code,</p>
  
  <pre><code>require('babel-polyfill'); 
  import { CALL_API } from 'redux-api-middleware'; 
  import C from '../constants';
  const API_ROOT = 'http://localhost:3000';
  function googleLogin() {   return async(dispatch) =&gt; {
      const actionResp = await dispatch({
        [CALL_API]: {
          endpoint: API_ROOT + '/auth/google',
          headers: {
            'Access-Control-Allow-Credentials': 'false',
            'Access-Control-Allow-Methods': 'GET',
            'Access-Control-Allow-Origin': API_ROOT
          },
          method: 'GET',
          types: ['GET', 'GET_SUCCESS', 'GET_FAILED']
        }
      });
  
      if (actionResp.error) {
        console.log(actionResp);
        throw new Error('Some error in communication', actionResp);
      } else {
        console.log(actionResp);
      }   
   }; 
  }
  </code></pre>
  
  <p>CORS settings in loopback middleware is as below,</p>
  
  <pre><code>"cors": {
     "params": {
        "origin": true,
        "credentials": false,
        "maxAge": 86400
      }
    }
  </code></pre>
  
  <p>This sounds like a simple problem, appreciate any help here.</p>