fix invitation and registration to use lowercase
This commit is contained in:
@@ -73,7 +73,7 @@ const getDB = new Promise((resolve, reject) => {
|
|||||||
DB.newInvitation = (userid, name, email)=>{
|
DB.newInvitation = (userid, name, email)=>{
|
||||||
const invitation = {
|
const invitation = {
|
||||||
responsable: new mongo.ObjectID(userid),
|
responsable: new mongo.ObjectID(userid),
|
||||||
email,
|
email: email.toLowerCase(),
|
||||||
name,
|
name,
|
||||||
ts: new Date()
|
ts: new Date()
|
||||||
}
|
}
|
||||||
@@ -88,6 +88,7 @@ const getDB = new Promise((resolve, reject) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
DB.getInvitation = (email)=>{
|
DB.getInvitation = (email)=>{
|
||||||
|
email = email.toLowerCase();
|
||||||
return DB.invitationCol.findOne({email}).catch((err)=>{
|
return DB.invitationCol.findOne({email}).catch((err)=>{
|
||||||
console.log(err);
|
console.log(err);
|
||||||
return "System Error";
|
return "System Error";
|
||||||
|
|||||||
Reference in New Issue
Block a user