Toggle organisation restriction from config file.

This commit is contained in:
Simon Vareille
2020-02-15 15:15:15 +01:00
parent 00e756795d
commit 86da9572a1
5 changed files with 24 additions and 7 deletions

View File

@@ -18,6 +18,7 @@
'use strict';
const crypto = require('crypto');
const config = require('config');
/**
* Checks for a valid string
@@ -87,7 +88,7 @@ exports.isFromOrganisation = function(data) {
if (!this.isString(data)) {
return false;
}
const re = /^([a-z0-9\-.]+)@([a-z0-9.\-]*)esisar\.grenoble-inp\.fr$/;
const re = new RegExp(config.publicKey.restrictionRegEx, 'g');
return re.test(data);
};