We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c203143 + 1a26c8a commit 54205c9Copy full SHA for 54205c9
1 file changed
routes/auth.js
@@ -8,7 +8,7 @@ router.post('/register', async (req, res) => {
8
try {
9
const { username, password } = req.body;
10
11
- const existingUser = await User.findOne({ username });
+ const existingUser = await User.findOne({ username: { $eq: username } });
12
if (existingUser) {
13
return res.status(400).json({ message: 'Username is in use' });
14
}
0 commit comments