remove console.log date debug log
This commit is contained in:
+1
-22
@@ -7,27 +7,6 @@ const axios = require("axios");
|
|||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
let date_time = new Date();
|
|
||||||
|
|
||||||
// get current date
|
|
||||||
// adjust 0 before single digit date
|
|
||||||
let date = ("0" + date_time.getDate()).slice(-2);
|
|
||||||
|
|
||||||
// get current month
|
|
||||||
let month = ("0" + (date_time.getMonth() + 1)).slice(-2);
|
|
||||||
|
|
||||||
// get current year
|
|
||||||
let year = date_time.getFullYear();
|
|
||||||
|
|
||||||
// get current hours
|
|
||||||
let hours = date_time.getHours();
|
|
||||||
|
|
||||||
// get current minutes
|
|
||||||
let minutes = date_time.getMinutes();
|
|
||||||
|
|
||||||
// get current seconds
|
|
||||||
let seconds = date_time.getSeconds();
|
|
||||||
|
|
||||||
// Set password for verification
|
// Set password for verification
|
||||||
|
|
||||||
const woof = process.env.DOG_NAMES ? process.env.DOG_NAMES.split(",") : [];
|
const woof = process.env.DOG_NAMES ? process.env.DOG_NAMES.split(",") : [];
|
||||||
@@ -161,7 +140,7 @@ router.post("/login", async (req, res) => {
|
|||||||
const isMatch = await bcrypt.compare(password, user.password);
|
const isMatch = await bcrypt.compare(password, user.password);
|
||||||
if (!isMatch) return res.status(401).json({ message: "Informations d'identification non valides" });
|
if (!isMatch) return res.status(401).json({ message: "Informations d'identification non valides" });
|
||||||
|
|
||||||
console.log("[" + year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds + "] " + user.name + " logged in")
|
console.log("[debug] " + user.name + " logged in")
|
||||||
|
|
||||||
// Check if the user role is 69 and set the admin flag
|
// Check if the user role is 69 and set the admin flag
|
||||||
const isAdmin = user.role === 69;
|
const isAdmin = user.role === 69;
|
||||||
|
|||||||
Reference in New Issue
Block a user