Skip to content

Commit c203143

Browse files
authored
Merge pull request #7 from Nec0ti/dev
Potential fix for code scanning alert no. 2: Database query built from user-controlled sources
2 parents 72476e2 + a30ded5 commit c203143

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)