# Pre-user-registration: Domain Based Registration action: Limitation the length of the domain list

**URL:** <https://community.auth0.com/t/pre-user-registration-domain-based-registration-action-limitation-the-length-of-the-domain-list/150088>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [October 18, 2024, 10:02am UTC](https://community.auth0.com/t/pre-user-registration-domain-based-registration-action-limitation-the-length-of-the-domain-list/150088 "2024-10-18T10:02:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![serhii.holub](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/serhii.holub/32/60177_2.png) [@serhii.holub](https://community.auth0.com/u/serhii.holub)\
**Post date:** [October 18, 2024, 10:02am UTC](https://community.auth0.com/t/pre-user-registration-domain-based-registration-action-limitation-the-length-of-the-domain-list/150088/1 "2024-10-18T10:02:26Z")

</div>

Hello, here.

There is a “pre-user-registration” trigger and a “Domain Based Registration” action.  
When I attempt to add additional domains (my domain list is quite long), I encounter the error “invalid InstalledIntegration.Configuration[0]: embedded message failed validation | caused by: invalid NameValue.Value: value length must be between 0 and 2048 runes, inclusive”.  
It seems there may be limitations in place.

Is it possible to resolve this issue or find a workaround?

Thanks,  
Serhii

 ![auth0-approved-domains](https://global.discourse-cdn.com/auth0/original/3X/0/d/0d7ba27cea7d091704f983f1a65b068c717ca267.png)

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [October 18, 2024, 12:01pm UTC](https://community.auth0.com/t/pre-user-registration-domain-based-registration-action-limitation-the-length-of-the-domain-list/150088/3 "2024-10-18T12:01:32Z")

</div>

Hi @serhii.holub

Welcome back to the Auth0 Community!

Thank you for posting your question. You can try to use an Action instead of the plug-and-play action from the marketplace. You can find more related resources about that in this Knowledge Solution → [Users are registering with email domains that we don't want to allow](https://community.auth0.com/t/users-are-registering-with-email-domains-that-we-dont-want-to-allow/95744)

I’m also sharing a small code snippet that would allow you to register from a `allowedDomain` list,

```auto
exports.onExecutePreUserRegistration = async (event, api) => {
  const allowedDomains = ['example.com',]; // Add your allow domains here

  // Extract the domain from the user's email
  const domain = event.user.email.split('@')[1].toLowerCase();

  // Check if the domain is in the allow list
  if (!allowedDomains.includes(domain)) {
    api.access.deny(`domain_not_allowed`,`Registration from domain ${domain} is not allowed.`);
  }
};

```

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 1, 2024, 12:02pm UTC](https://community.auth0.com/t/pre-user-registration-domain-based-registration-action-limitation-the-length-of-the-domain-list/150088/4 "2024-11-01T12:02:28Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
