Skip to content

Commit a30ded5

Browse files
Potential fix for code scanning alert no. 2: Database query built from user-controlled sources
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 2e75e16 commit a30ded5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

routes/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ router.post('/login', async (req, res) => {
2626
try {
2727
const { username, password } = req.body;
2828

29-
const user = await User.findOne({ username });
29+
const user = await User.findOne({ username: { $eq: username } });
3030
if (!user) {
3131
return res.status(400).json({ message: 'User not found' });
3232
}

0 commit comments

Comments
 (0)