FIX: Always use the current session token in uppy (#23812)

…rather than the value at the time when uppy is initialized.

Future TODO: extract csrf-fetching logic from ajax helper to Session service.
This commit is contained in:
Jarek Radosz 2023-10-06 15:26:39 +02:00 committed by GitHub
parent 057c2012f0
commit 2c490773f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -544,9 +544,9 @@ export default Mixin.create(ExtendableUploader, UppyS3Multipart, {
_useXHRUploads() {
this._uppyInstance.use(XHRUpload, {
endpoint: getURL(`/uploads.json?client_id=${this.messageBus.clientId}`),
headers: {
headers: () => ({
"X-CSRF-Token": this.session.csrfToken,
},
}),
});
},

View File

@ -350,9 +350,9 @@ export default Mixin.create(UppyS3Multipart, ExtendableUploader, {
_useXHRUploads() {
this._uppyInstance.use(XHRUpload, {
endpoint: this._xhrUploadUrl(),
headers: {
headers: () => ({
"X-CSRF-Token": this.session.csrfToken,
},
}),
});
},