diff --git a/routes/users.js b/routes/users.js index 13da3ede5d57415fd6a474d353b623482b5b0a2a..cac24a29f384b438f4f0dd7ef041b9ae0c51f678 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) {