CORS Issue

I deployed a laravel project on infinityfree, the request is been blocked by the CORS.

Here is the error;
“Access to XMLHttpRequest at ‘http://steviano.infinityfreeapp.com/api/login’ from origin ‘http://localhost:5174’ 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.”

Everything is working perfectly locally, I don’t know why it is been blocked because I allowed the origin.
I am using Vue with Laravel.

Hi and welcome to the forum

Using AJAX from another site to a site hosted with us is not possible because of this security system:

You can only use AJAX on the same website. If that’s not an option, please consider switching to premium hosting which does not have this restriction.

9 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.