Updated vague DB query which could lead to pwned accounts
This commit is contained in:
parent
d7c55fe3da
commit
be01417cdf
3 changed files with 3 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ module.exports.post = async function(req, res){
|
|||
return res.send('Invalid Session! Cannot delete account while logged out!');
|
||||
}
|
||||
|
||||
const userDB = await userModel.findOne(user);
|
||||
const userDB = await userModel.findOne({user: user.user});
|
||||
|
||||
|
||||
if(!userDB){
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ module.exports.post = async function(req, res){
|
|||
const {field, change} = data;
|
||||
const {user} = req.session;
|
||||
|
||||
const userDB = await userModel.findOne(user);
|
||||
const userDB = await userModel.findOne({user: user.user});
|
||||
const update = {};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue