ckeditor-nuxt
ckeditor-nuxt copied to clipboard
Help with CORS in Nuxt/Laravel for image upload
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?