| PixLab  & FACEIO | Knowledge Sharing & Public Forums


When I hit the API, it gives a CORS origin error.

Asked
Modified
Viewed 27472 times
9

When I hit the API, it gives a CORS origin error.

"Access to XMLHttpRequest at 'https://api.faceio.net/setfacialidpincode' from origin 'https://app.stablecrypto.in' 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.


Accepted Solution

20

Hello,

Thank you for reaching out, and welcome to the FACEIO Support Center. To answer your inquiry:

The error you're seeing is related to Cross-Origin Resource Sharing (CORS). CORS is a security feature implemented by web browsers to prevent unauthorized domains from making requests to another domain, which can be potentially harmful. Here's a breakdown of the error message:

  • XMLHttpRequest at  api.faceio.net/setfacialidpincode documented here. This indicates that there was an attempt to make an XMLHttpRequest (often used for AJAX requests) to the specified URL from your Vue or React web app.
  • has been blocked by CORS policy: This indicates that the browser blocked the request because it violates the CORS policy.

  • Response to preflight request doesn't pass access control check: Before making the actual request, browsers send a "preflight" request (using the HTTP OPTIONS method) to check if the actual request is allowed. This error suggests that this preflight request failed its check.

Solution:

Let us know if you need further assistance!