Etheryte / vue-auto-dropzone

A Dropzone component for Vue. Typescript support, native slots, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing CSRF token with post

codemonkey76 opened this issue · comments

I am having trouble passing the CSRF token from laravel / vuejs app. I tried using
headers: {'_token' : this.csrf} in the dropzone options as well as including hidden input in between the tags, as well as including the inside a form with a hidden field, none of these methods passed the CSRF token with the file.

what am i doing wrong?

Sadly I'm not familiar with Laravel. If simply specifying the token doesn't seem to work, please provide a a minimal, reproducible example.

const options = {
    url: 'https://httpbin.org/anything',
    headers: {
         'X-CSRF-Token': 'foo',
    },
};

Are you sure the token is defined when the instance is created?

commented

This discussion has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still relevant, please comment explaining why. Thanks!