function checkAllowedDomains(allowedDomains, email) {
  if (allowedDomains) {
    const domain = email.split('@').pop().toLowerCase();
    const domains = allowedDomains
      .split(' ')
      .map((domain) => domain.trim().toLowerCase());

    return domains.includes(domain);
  }
  return false;
}
Test either email matches allowed domain
@param {string} allowedDomains allowed domains from config. space separated values
@param {string} email
@returns {boolean}