mirror of
https://github.com/discourse/discourse.git
synced 2025-01-22 16:08:31 +08:00
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:
parent
057c2012f0
commit
2c490773f1
|
@ -544,9 +544,9 @@ export default Mixin.create(ExtendableUploader, UppyS3Multipart, {
|
||||||
_useXHRUploads() {
|
_useXHRUploads() {
|
||||||
this._uppyInstance.use(XHRUpload, {
|
this._uppyInstance.use(XHRUpload, {
|
||||||
endpoint: getURL(`/uploads.json?client_id=${this.messageBus.clientId}`),
|
endpoint: getURL(`/uploads.json?client_id=${this.messageBus.clientId}`),
|
||||||
headers: {
|
headers: () => ({
|
||||||
"X-CSRF-Token": this.session.csrfToken,
|
"X-CSRF-Token": this.session.csrfToken,
|
||||||
},
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -350,9 +350,9 @@ export default Mixin.create(UppyS3Multipart, ExtendableUploader, {
|
||||||
_useXHRUploads() {
|
_useXHRUploads() {
|
||||||
this._uppyInstance.use(XHRUpload, {
|
this._uppyInstance.use(XHRUpload, {
|
||||||
endpoint: this._xhrUploadUrl(),
|
endpoint: this._xhrUploadUrl(),
|
||||||
headers: {
|
headers: () => ({
|
||||||
"X-CSRF-Token": this.session.csrfToken,
|
"X-CSRF-Token": this.session.csrfToken,
|
||||||
},
|
}),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user