title: Reactjs Axios / Spring boot security
body: <p>I have a Java application developed with Spring Boot which is the back-end.
  The front-end is an application developed in ReactJs. I use REST services. 
  I use axios for REST calls.
  I recently enabled the security in Spring Boot. Now I have difficulty to authenticate axios calls. </p>
  
  <pre><code>var config = {
          auth: {
              username: 'bruker',
              password: 'passord'
          }
  
      };
      axios.get('http://localhost:8090/employee/all', config).then(function (response) {
          console.log(response)
      }.bind(this)).catch(function (response) {
          console.log(response)
      }.bind(this))
  </code></pre>
  
  <p>I get the following error "Response for preflight is invalid (redirect)"
  I assume the response is a redirected to <code>localhost:8090/login</code>
  I haven't found any solutions to this. What do I do wrong? </p>