From aae4119ed11f8925fc283b698bf95f67dda8b69f Mon Sep 17 00:00:00 2001
From: Jesus Galaz <jesusgalazr@icloud.com>
Date: Wed, 16 Oct 2024 05:49:16 +0200
Subject: [PATCH] Deleting any king of console.log vulnerabilities

---
 routes/users.js | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/routes/users.js b/routes/users.js
index 13da3ed..cac24a2 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -31,25 +31,21 @@ router.post('/register', async (req, res) => {
 // LogIn User
 router.post('/login', async (req, res) => {
   const { username, password } = req.body;
-  console.log('Attempting to log in:', username);
 
   try {
     const user = await User.findOne({ username });
-    console.log('User found:', user);
 
     if (!user) {
       return res.status(400).json({ error: 'Invalid username or password' });
     }
 
     const isMatch = await bcrypt.compare(password, user.password);
-    console.log('Password match:', isMatch);
 
     if (!isMatch) {
       return res.status(400).json({ error: 'Invalid username or password' });
     }
 
     req.session.user = { id: user._id, username: user.username };
-    console.log('User logged in:', req.session.user);
 
     res.json({ success: true, message: 'Login successful' });
   } catch (error) {
-- 
GitLab