Pass csrf token to blueimp fileupload
I am creating a SPA (Single Page Application) using AngularJS and for FileUpload I am trying to use Blueimp file upload. The server side is in NodeJS using csrf, so all requests will be sent to the server using the csrf token (X-XSRF-TOKEN set by AngularJS). Now when I try to upload a file using Blueimp it fails with
"Error: Invalid csrf token"
since it binds the required token in the request, now I'm wondering how to set the token. Please note that I am already using AngularJS and I don't have the meta tag set in the csrf, but the token is available in the cookies.
Thank!
+3
source to share
3 answers
If I understand correctly, you can write an intersector that sets the token in the request header: AngularJS $ http
-1
source to share