...
 
Commits (2)
......@@ -6,10 +6,12 @@ import SimpleSchema from 'simpl-schema';
export function checkDomain(email) {
let res = false;
const domainMail = email.split('@')[1];
// Put whiteDomain in config ?
const whiteDomains = [/^ac-[a-z-]*\.fr/, /^[a-z-]*\.gouv\.fr/];
const whiteDomains = Meteor.settings.private.whiteDomains || [];
whiteDomains.forEach((whiteDomain) => {
if (whiteDomain.test(domainMail)) res = true;
if (new RegExp(whiteDomain).test(domainMail)) {
console.log(` Email domain matches ${whiteDomain}: user activated`);
res = true;
}
});
return res;
}
......
......@@ -45,6 +45,10 @@
"minioSecret": "Pr6SvbtBkutUHmdlN2uYWi5g7oo5EZquMq9k2t00",
"apiKeys": [
"849b7648-14b8-4154-9ef2-8d1dc4c2b7e9"
],
"whiteDomains": [
"^ac-[a-z-]*\\.fr",
"^[a-z-]*\\.gouv.fr"
]
}
}