title: Nuxt.js POSTing to a parse server inside asyncData results in cross-origin error
body: <p>I am using nuxt to build a client that fetches data from parse server.
  In my index.vue I am sending request to the parse server inside asyncData. I am on development server serving at localhost:3000.</p>
  
  <p>Here is a part of my index.vue file</p>
  
  <pre><code>export default {
      asyncData() {
          let user = new Parse.User()
  
          user.set('email', 'email@company.com')
          user.set('username', 'sample_user')
          user.set('created_at', '2018-04-04')
          user.set('updated_at', '2018-04-04')
          return user
            .save()
            .then(response =&gt; console.log(response))
         }
      }
  }
  </code></pre>
  
  <p>I am getting this error on my <em>Chrome</em> browser's (I am using Chrome by the way) console</p>
  
  <p><code>POST https://api.parse.com/1/users 410
  Access to XMLHttpRequest at 'https://api.parse.com/1/users' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.</code></p>
  
  <p>I tried adding cors as middleware to server/index.js as follows</p>
  
  <pre><code>const cors = require('cors')
  app.use(cors())
  </code></pre>
  
  <p>But nothing changed. How can I overcome the 'ever-present' Access-Control-Allow-Origin error.</p>
  
  <p><strong>UPDATE After @Nicolas Pennec's answer</strong></p>
  
  <p>I tried creating a sign in with google feature and changed my nuxt.config.js configuration and added the following:</p>
  
  <pre><code>auth: {
      strategies: {
        google: {
          client_id:
            '****.apps.googleusercontent.com'
        }
      },
      redirect: {
        login: '/login',
        logout: '/',
        callback: '/login',
        home: '/'
      }
    }
  </code></pre>
  
  <p>It authenticates with google properly and redirects back to my login route. It encounters error and shows the following on the console:</p>
  
  <pre><code>OPTIONS https://www.googleapis.com/oauth2/v3/userinfo 403
  Access to XMLHttpRequest at 'https://www.googleapis.com/oauth2/v3/userinfo' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  [ERROR] [AUTH] Error: Network Error
  </code></pre>