Hopefully plugged an undefined username hole
This commit is contained in:
@@ -9,7 +9,7 @@ const route = async (req, res) => {
|
|||||||
}, {
|
}, {
|
||||||
where: {
|
where: {
|
||||||
username: {
|
username: {
|
||||||
[Op.eq]: req.body.username
|
[Op.eq]: req.body.username || ''
|
||||||
},
|
},
|
||||||
admin: {
|
admin: {
|
||||||
[Op.not]: true
|
[Op.not]: true
|
||||||
@@ -27,7 +27,7 @@ const route = async (req, res) => {
|
|||||||
//forcibly logout
|
//forcibly logout
|
||||||
tokens.destroy({
|
tokens.destroy({
|
||||||
where: {
|
where: {
|
||||||
username: req.body.username
|
username: req.body.username || ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const route = async (req, res) => {
|
|||||||
}, {
|
}, {
|
||||||
where: {
|
where: {
|
||||||
username: {
|
username: {
|
||||||
[Op.eq]: req.body.username
|
[Op.eq]: req.body.username || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const route = async (req, res) => {
|
|||||||
}, {
|
}, {
|
||||||
where: {
|
where: {
|
||||||
username: {
|
username: {
|
||||||
[Op.eq]: req.body.username
|
[Op.eq]: req.body.username || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ router.use(tokenAuth);
|
|||||||
router.use(async (req, res, next) => {
|
router.use(async (req, res, next) => {
|
||||||
const record = await accounts.findOne({
|
const record = await accounts.findOne({
|
||||||
where: {
|
where: {
|
||||||
username: req.user.username
|
username: req.user.username || ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const route = async (req, res) => {
|
|||||||
}, {
|
}, {
|
||||||
where: {
|
where: {
|
||||||
username: {
|
username: {
|
||||||
[Op.eq]: req.body.username
|
[Op.eq]: req.body.username || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const route = async (req, res) => {
|
|||||||
}, {
|
}, {
|
||||||
where: {
|
where: {
|
||||||
username: {
|
username: {
|
||||||
[Op.eq]: req.body.username
|
[Op.eq]: req.body.username || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ router.use(tokenAuth);
|
|||||||
router.use(async (req, res, next) => {
|
router.use(async (req, res, next) => {
|
||||||
const record = await accounts.findOne({
|
const record = await accounts.findOne({
|
||||||
where: {
|
where: {
|
||||||
username: req.user.username
|
username: req.user.username || ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const route = async (req, res) => {
|
|||||||
//get the existing account
|
//get the existing account
|
||||||
const account = await accounts.findOne({
|
const account = await accounts.findOne({
|
||||||
where: {
|
where: {
|
||||||
email: req.body.email
|
email: req.body.email || ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const validateDetails = async (body) => {
|
|||||||
//check for existing username
|
//check for existing username
|
||||||
const usernameRecord = await accounts.findOne({
|
const usernameRecord = await accounts.findOne({
|
||||||
where: {
|
where: {
|
||||||
username: body.username
|
username: body.username || ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const route = async (req, res) => {
|
|||||||
//get the existing pending signup
|
//get the existing pending signup
|
||||||
const info = await pendingSignups.findOne({
|
const info = await pendingSignups.findOne({
|
||||||
where: {
|
where: {
|
||||||
username: req.query.username
|
username: req.query.username || ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ const route = async (req, res) => {
|
|||||||
//delete the pending signup
|
//delete the pending signup
|
||||||
pendingSignups.destroy({
|
pendingSignups.destroy({
|
||||||
where: {
|
where: {
|
||||||
username: req.query.username
|
username: req.query.username || ''
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user