Invitation only for signup
This commit is contained in:
4
index.js
4
index.js
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user