I am trying to make a POST request from my localhost to a remote server and I am getting the error "Access to XMLHttpRequest at 'https://chat-app-main-server.vercel.app/api/auth/login' from origin 'http://127.0.0.1:5173' has been blocked by CORS policy." The strange thing is that the code works fine when I run it locally, but it fails when I try to run it on a remote server.
I have tried adding the following headers to my request, but it doesn't seem to help.:
I am not sure what else to try. How can I troubleshoot this issue and fix it?