check for empty tokens
This commit is contained in:
parent
82f8ffc04e
commit
60e093f123
|
@ -20,6 +20,7 @@ const validateInviteToken = async (req, res, next) => {
|
|||
if (process.env.REQUIRE_TOKEN != "true") return next();
|
||||
|
||||
const { inviteToken } = req.body;
|
||||
if (!inviteToken || inviteToken == "") return res.status(400).send("Token is not valid");
|
||||
fs.appendFileSync('./inviteTokens.txt', '');
|
||||
const inviteTokens = fs.readFileSync('./inviteTokens.txt').toString().split('\n');
|
||||
let tokenValid = false;
|
||||
|
|
Loading…
Reference in New Issue