diff --git a/package.json b/package.json index 00742d0..de13695 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neutral", - "version": "DEV_5.0", + "version": "DEV_5", "private": true, "nodemonConfig": { "ext": "js, html", diff --git a/public/images/userspics/root.png b/public/images/userspics/root.png index 0bf778b..6266fde 100644 Binary files a/public/images/userspics/root.png and b/public/images/userspics/root.png differ diff --git a/routes/upload.js b/routes/upload.js index 9fcf097..e6eba26 100644 --- a/routes/upload.js +++ b/routes/upload.js @@ -38,8 +38,6 @@ router.post("/", function(req, res, next) { const image = req.files.apic - console.log("test") - if(req.headers.uploadforuser != null) { if(check.permLevel == 4) { @@ -48,7 +46,8 @@ router.post("/", function(req, res, next) { var uploadPath = ""; var uploadDir = __dirname.replace("routes","public" + path.sep + "images" + path.sep + "userspics" + path.sep) - + + if(req.files.apic.mimetype == "image/png") { uploadPath = req.headers.uploadforuser + ".png" @@ -59,7 +58,7 @@ router.post("/", function(req, res, next) { uploadPath = req.headers.uploadforuser+ ".jpg" } - image.mv(uploadPath, function(err) { + image.mv(__dirname + path.sep + uploadPath, function(err) { if(err) { res.send({"result":"success", "content": "La photo de profil n'a pas pu être chargé."}) console.log(err) @@ -176,7 +175,7 @@ router.post("/", function(req, res, next) { uploadPath = ntr.checkToken(req, res).name + ".jpg" } - image.mv(uploadPath, function(err) { + image.mv(__dirname + path.sep + uploadPath, function(err) { if(err) { res.send({"result":"success", "content": "La photo de profil n'a pas pu être chargé."}) console.log(err) diff --git a/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json b/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json index a741a72..5954462 100644 --- a/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json +++ b/users/0cee5da6-6812-49d8-97f5-2df5c1d78191.json @@ -9,5 +9,5 @@ "livableToken": true, "createdAt": 1679260759114 }, - "lastconnexion": 1679594165151 + "lastconnexion": 1679594782961 } \ No newline at end of file diff --git a/users/c8f353a4-d0df-4c10-bccc-d4f47daf0f51.json b/users/c8f353a4-d0df-4c10-bccc-d4f47daf0f51.json index 37fa7b5..f7b3f0b 100644 --- a/users/c8f353a4-d0df-4c10-bccc-d4f47daf0f51.json +++ b/users/c8f353a4-d0df-4c10-bccc-d4f47daf0f51.json @@ -4,10 +4,6 @@ "uuid": "c8f353a4-d0df-4c10-bccc-d4f47daf0f51", "fullname": "Administrateur", "permissionLevel": 4, - "token": { - "tokenID": "c750c10a-f69d-4dd2-8a35-65d8a74897bb", - "livableToken": false, - "createdAt": 1677339320398 - }, + "token": {}, "lastconnexion": 1677339336836 } \ No newline at end of file