Hopefully plugged an undefined username hole

This commit is contained in:
2021-04-28 21:00:48 +10:00
parent e141583f91
commit 768352b804
11 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ router.use(tokenAuth);
router.use(async (req, res, next) => {
const record = await accounts.findOne({
where: {
username: req.user.username
username: req.user.username || ''
}
});
+1 -1
View File
@@ -19,7 +19,7 @@ const route = async (req, res) => {
//get the existing account
const account = await accounts.findOne({
where: {
email: req.body.email
email: req.body.email || ''
}
});
+1 -1
View File
@@ -70,7 +70,7 @@ const validateDetails = async (body) => {
//check for existing username
const usernameRecord = await accounts.findOne({
where: {
username: body.username
username: body.username || ''
}
});
+2 -2
View File
@@ -5,7 +5,7 @@ const route = async (req, res) => {
//get the existing pending signup
const info = await pendingSignups.findOne({
where: {
username: req.query.username
username: req.query.username || ''
}
});
@@ -29,7 +29,7 @@ const route = async (req, res) => {
//delete the pending signup
pendingSignups.destroy({
where: {
username: req.query.username
username: req.query.username || ''
}
});