0

I'm trying to login to my web application (made in react) and I'm using a xampp apache server on localhost, when I try to send post request to my php file it returns this error:

[Error] XMLHttpRequest cannot load http://localhost/project/authentication.php due to access control checks.

my request looks like this:

export async function doLogin(data: LoginCredentials) {
  const res = await axios.post('http://localhost:80/project/authentication.php',
    data
  );
  return await res.data;
}

what can I do?

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Crocio
  • 88
  • 8
  • 1
    So how do you know its a 500 error, thats not mentioned in any of the errors you show – RiggsFolly Nov 17 '21 at 18:10
  • you're right @RiggsFolly, I just supposed, my bad, editing now – Crocio Nov 17 '21 at 18:33
  • Does this answer your question? [Safari 10.1: XMLHttpRequest with query parameters cannot load due to access control checks](https://stackoverflow.com/questions/43517254/safari-10-1-xmlhttprequest-with-query-parameters-cannot-load-due-to-access-cont) – Vytas Nov 18 '21 at 22:32
  • @Vytas there is no accepted answer so I guess it doesn't – Crocio Nov 20 '21 at 08:38

0 Answers0