[#1000] Access to XMLHttpRequest at 'https://user-api-v2.simplybook.me/admin/auth' from origin 'http://localhost:9090' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Migrated from Redmine #1000 | Author: Nic P
Status: New | Priority: High, I’m very impatient | Created: 2023-01-17


I have CORS issue with https://user-api-v2.simplybook.me/admin/auth.

This is the initial error:


Access to XMLHttpRequest at 'https://user-api-v2.simplybook.me/admin/auth' from origin 'http://localhost:9090' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I tried:


axios({
  method: 'get',
  url: 'https://user-api-v2.simplybook.me/admin/auth',
  crossdomain: true,
  headers: {
    "content-type": "application/json",
    "Access-Control-Allow-Origin": '*'
  },
  data: {
    company: 'immersivemoto',
    login: 'xxx',
    password: "xxx"
  }
}).then(function(response) {
  console.log(response)
});

Error:


Access to XMLHttpRequest at 'https://user-api-v2.simplybook.me/admin/auth' from origin 'http://localhost:9090' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.

So, right now I’m blocked. I can’t develop my booking page.

Nic P wrote:

Method is POST not GET.

Nic P wrote:

Well, never mind. I removed the Access-Control-Allow-Origin and it’s working now.