getting error 419 in Laravel with Q-uploader #14601
-
What happened?I'm using the qUploader to upload some images to a laravel backend and is returning me a 419 error which I suppose is CSRF error, I tried many variations of this, with credentials, without credentials, with csrf token header and without and still gives a 419 error. the weird thing is that I tried a new quasar project, copied this code to the new project and it works, even without logging in (which is OK, because that endpoint is open to anyone) I'm also trying a separated method to send the file to the endpoint (which is working correctly using axios), but I'm trying to abort the upload from the q-uploader by using qUploader.value.abort() and qUploader.value.reset(), and is not aborting the upload from the quploader to prevent trying to send the file a second time. I'm kind of lost here because I've also compared the request response and headers with the chrome inspect tool at the network tab and the only difference I see is the cookie but not much, perhaps I'm not looking at the right place. this is an isolated page inside the installation to show a clearer code without all the other mumbo jumbo that still doesn't work would really appreciate some help with this. What did you expect to happen?I was expecting it to work without giving a 419 error. Reproduction URLHow to reproduce?I tried this in a new quasar installation and is working, so I'm not sure what's going on. Also tried this in a new page in the quasar installation that is not working and it doesn't work. FlavourQuasar CLI with Vite (@quasar/cli | @quasar/app-vite) AreasQuasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), Components (quasar) Platforms/BrowsersChrome Quasar info outputNo response Relevant log outputNo response Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Hi @asdrubalp9! 👋 It looks like you provided an invalid or unsupported reproduction URL. Without a proper reproduction, your issue will have to get closed. Thank you for your collaboration. 👏 |
Beta Was this translation helpful? Give feedback.
-
|
@asdrubalp9 Did you solve it? I'm going through the same problem. |
Beta Was this translation helpful? Give feedback.
import { Cookies, useQuasar } from 'quasar'
...
headers: [ { name: 'Accept', value: 'application/json' }, { name: 'X-XSRF-TOKEN', value: Cookies.get('XSRF-TOKEN') } ],