From 6df7873c907024285504f6ad684ecc1d1f9b7141 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 6 Jan 2023 21:22:22 -0800 Subject: use uuid for images --- lib/upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/upload.js b/lib/upload.js index 8d1c85ef..95dfe21a 100644 --- a/lib/upload.js +++ b/lib/upload.js @@ -32,7 +32,7 @@ app.post("/upload/:type", auth, async function(req, res) { if (format !== "image" && !["jpg", "jpeg", "png"].includes(ext)) throw new Error("unsupported file type"); - let name = `${req.user.username}-${type}.webp`; + let name = `${req.user.uuid}-${type}.webp`; let path = `/app/uploads/${name}`; let size = type === "banner" ? 1920 : 240; -- cgit v1.2.3