Skip to content

Commit 1a26c8a

Browse files
Potential fix for code scanning alert no. 1: 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 346f3a8 commit 1a26c8a

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
@@ -8,7 +8,7 @@ router.post('/register', async (req, res) => {
88
try {
99
const { username, password } = req.body;
1010

11-
const existingUser = await User.findOne({ username });
11+
const existingUser = await User.findOne({ username: { $eq: username } });
1212
if (existingUser) {
1313
return res.status(400).json({ message: 'Username is in use' });
1414
}

0 commit comments

Comments
 (0)