aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-01-06 21:22:22 -0800
committerAdam Soltys <[email protected]>2023-01-06 21:22:22 -0800
commit6df7873c907024285504f6ad684ecc1d1f9b7141 (patch)
tree9ad8750650606e0d35290c1cb447f31accdfbd36
parentb6b806d142590a121c79c811b7fbb1f5ac6cdaa6 (diff)
downloadcoinos-server-6df7873c907024285504f6ad684ecc1d1f9b7141.tar.gz
coinos-server-6df7873c907024285504f6ad684ecc1d1f9b7141.zip
use uuid for images
-rw-r--r--lib/upload.js2
1 files changed, 1 insertions, 1 deletions
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;