chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
557 stars 136 forks source link

csrf token dropzoneOptions #61

Open keradan opened 6 years ago

keradan commented 6 years ago

When I set uploadURL and try to load images on server I get csrf error. On the server side I have Laravel API. How can I set csrf token in wysiwyg image dropzoneOptions?

keradan commented 6 years ago

I tried this :

dropzoneOptions: {
    params: {
        '_token' : my_csrf_token,
    },
}

But nothing on the server side, only file

keradan commented 6 years ago

For now I found some ugly decision:

image: {
    uploadURL: "api_link" + "?_token=" + my_csrf_token,
    dropzoneOptions: {},
}

And it is working. But I will be happy if there is more natural way to make it.