fix error when special code is missing

This commit is contained in:
hippoz 2021-01-03 17:14:25 +02:00
parent da3962b9f1
commit a5d021972b
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -23,11 +23,13 @@ const createAccountLimiter = rateLimit({
}); });
app.get('/account/create/info', async (req, res) => { app.get('/account/create/info', async (req, res) => {
const restrictions = config.restrictions.signup;
let requiresCode = false; let requiresCode = false;
if (config.restrictions) {
const restrictions = config.restrictions.signup;
if (restrictions && restrictions.specialCode) { if (restrictions && restrictions.specialCode) {
requiresCode = true; requiresCode = true;
} }
}
res.json({ res.json({
error: false, error: false,