From c9fc8801378e2d5ff55b157662236626080ff37b Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Mon, 30 Oct 2017 22:35:30 -0700 Subject: [PATCH] include user id in the uploads path --- server/api/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/user.js b/server/api/user.js index 15e4ed6b..64b3676f 100644 --- a/server/api/user.js +++ b/server/api/user.js @@ -18,7 +18,7 @@ router.post('user.s3Upload', auth(), async ctx => { ctx.assertPresent(size, 'size is required'); const s3Key = uuid.v4(); - const key = `uploads/${s3Key}/${filename}`; + const key = `uploads/${ctx.state.user.id}/${s3Key}/${filename}`; const policy = makePolicy(); ctx.body = {