check for empty tokens
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user