mercredi 20 juin 2018

Add auth token in request header in ember-file-upload

I am using ember vesrion 2.15.1 for my application. I am using ember-file-upload node module to support file upload and that is successful. Challenge is I am not able to add auth token to the request header. My request header looks like this:

enter image description here I am not able to add userAuthToken in request header of file upload like below which I am able to add for other api calls:

enter image description here

I have tried uploading the file via

set(file, 'headers.userAuthToken', localStorage.getItem("userToken")); // this line is creating problems
let response = yield file.upload(url);

But unable to add userAuthToken in request header. Any fix or workaround will be appreciated.




Aucun commentaire:

Enregistrer un commentaire