Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with CORS in Nuxt/Laravel for image upload #31

Open
eokwukwe opened this issue Sep 25, 2021 · 0 comments
Open

Help with CORS in Nuxt/Laravel for image upload #31

eokwukwe opened this issue Sep 25, 2021 · 0 comments

Comments

@eokwukwe
Copy link

Hello @blowstack.

I will need help in dealing with the cors error I am having when I try to upload images.

I am using Laravel for my API with authentication using Laravel Sanctum. This means that I have to set withCredentials to true in the simpleUpload option. So I have

simpleUpload: {
  uploadUrl: <api_upload_url>,
  withCredentials: true,
  headers: {
    'X-XSRF-TOKEN': this.$cookies.get('XSRF-TOKEN'),
  },
},

But I still get cors error. I have tried adding 'Access-Control-Allow-Origin': '*' to the headers but it didn't work. However, every other request to the API works.

Any idea what I am missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant