Disable registration

This commit is contained in:
Chord 2019-12-30 14:36:11 -05:00
parent d36fbbde9a
commit 3c5482a4c7
3 changed files with 7 additions and 1 deletions

View file

@ -7,7 +7,10 @@ api.post('/register', async (req, res, next) => {
const rUsername = req.body.username;
const rPassword = req.body.password;
const rEmail = req.body.email; // TODO: validate email regex
// TODO: recaptcha, csrf protection
res.status(403).json({message: "Registration is disabled"});
return;
if (!rUsername || !rPassword || !rEmail) {
res.status(400).json({message: "missing fields"});