yayyy not testing commits

This commit is contained in:
hippoz 2020-12-11 00:36:52 +02:00
parent bc75e3f24c
commit 7d1882895b

View file

@ -50,19 +50,21 @@ app.post('/account/create', [
return; return;
} }
const restrictions = config.restrictions.signup; if (config.restrictions) {
if (restrictions && restrictions.specialCode) { const restrictions = config.restrictions.signup;
const passedSpecialCode = req.body.specialCode; if (restrictions && restrictions.specialCode) {
const specialCode = restrictions.specialCode; const passedSpecialCode = req.body.specialCode;
const specialCode = restrictions.specialCode;
if (passedSpecialCode && specialCode) {
if (specialCode !== passedSpecialCode) { if (passedSpecialCode && specialCode) {
if (specialCode !== passedSpecialCode) {
res.status(401).json({ error: true, message: 'ERROR_REQUEST_SPECIAL_CODE_MISSING', errors: [{ msg: 'No specialCode passed', param: 'specialCode', location: 'body' }] });
return false;
}
} else {
res.status(401).json({ error: true, message: 'ERROR_REQUEST_SPECIAL_CODE_MISSING', errors: [{ msg: 'No specialCode passed', param: 'specialCode', location: 'body' }] }); res.status(401).json({ error: true, message: 'ERROR_REQUEST_SPECIAL_CODE_MISSING', errors: [{ msg: 'No specialCode passed', param: 'specialCode', location: 'body' }] });
return false; return false;
} }
} else {
res.status(401).json({ error: true, message: 'ERROR_REQUEST_SPECIAL_CODE_MISSING', errors: [{ msg: 'No specialCode passed', param: 'specialCode', location: 'body' }] });
return false;
} }
} }