thecodeholic / laravel-vue-survey

This is a full stack application of Vue 3 with Tailwindcss 3 and Laravel 8
https://yoursurveys.xyz
328 stars 178 forks source link

Cross origin resource sharing issue #9

Open Emmybritt opened 2 years ago

Emmybritt commented 2 years ago

Hi 👋 theCodeholic, thanks for sharing a very helping content, I am currently running through an issue related to cross origin resource sharing, when I tried to create new survey, after implementing the code you, showed in the video, I have been having this same issue over and over for couple of weeks, I have tried different ways, just to see that I'm able to remove the errors, but all effort proved abortive, I don't know if you can help me on what to do to solve this problem, I would appreciate if you would drop a video, regarding this issue... Thanks alot

thecodeholic commented 2 years ago

First of all which browser do you use? Very often when I use Google Chrome it shows me CORS error, but actually the error is something else. Check if Firefox and observe what error it actually is by looking at response. Laravel has CORS automatically enabled and you should not have any issues unless you don't have errors.

Emmybritt commented 2 years ago

I'm using Google chrome browser for my development... But actually I was able to resolve the issue. What I did was that I downloaded an extension called add-ons for unblocking cors policy in my Google chrome, after adding the extension, the errors went off, when i went further to make my research about this cors policy I found out that I could also enable this in my laravel application, and I tried it by adding some configuration in my cors.php file located inside the config directory but still did not work... And have been left with this question, won't this cors policy affect my application when deployed to an online server since they are using a different header and domain

ecmanriquejrdev commented 2 years ago

Good day I haven't completed yet the error I encountered regarding to the CSRF image