X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fuploadx.ts;h=34a4461f0b8303c3cd178360fe34d39647eea692;hb=57e4e1c1a95c3a81a967f54ecc2a510d8b0e129c;hp=36f5a556c6d7effb4d3bffc7c80290628bc590ea;hpb=3318147300b4f998adf728eb0a5a14a4c1829c51;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/uploadx.ts b/server/lib/uploadx.ts index 36f5a556c..34a4461f0 100644 --- a/server/lib/uploadx.ts +++ b/server/lib/uploadx.ts @@ -5,9 +5,13 @@ import { Uploadx } from '@uploadx/core' const uploadx = new Uploadx({ directory: getResumableUploadPath(), // Could be big with thumbnails/previews - maxMetadataSize: '10MB' + maxMetadataSize: '10MB', + userIdentifier: (_, res: express.Response) => { + if (!res.locals.oauth) return undefined + + return res.locals.oauth.token.user.id + '' + } }) -uploadx.getUserId = (_, res: express.Response) => res.locals.oauth?.token.user.id export { uploadx