Invitation only for signup

This commit is contained in:
Adolfo Reyna
2021-10-04 10:13:06 -07:00
parent e886b2bd57
commit 74f9108fa7
9 changed files with 192 additions and 10 deletions

View File

@@ -73,7 +73,9 @@ DB.getDB.then((DB)=>{
const password = req.query.password || req.body.password;
const email = req.query.email || req.body.email;
const profile = req.query.profile || req.body.profile;
if(!username || !password || !email) return res.json({status: "fail"})
if(!username || !password || !email) return res.json({status: "fail"});
//Check if the new user has an invitation
if(!await DB.getInvitation(email)) return res.json({status: "Not invitation found!"});
//const hashedPassword = await bcrypt.hash(password, 10);
const hashedPassword = await bcrypt.hash(password, 10);
const response = await DB.newUser({