# Restrict new-user signup

**URL:** <https://community.auth0.com/t/restrict-new-user-signup/90495>\
**Category:** Get Help\
**Created:** [September 13, 2022, 8:27am UTC](https://community.auth0.com/t/restrict-new-user-signup/90495 "2022-09-13T08:27:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![da.ente](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/da.ente/32/33194_2.png) [@da.ente](https://community.auth0.com/u/da.ente)\
**Post date:** [September 13, 2022, 8:27am UTC](https://community.auth0.com/t/restrict-new-user-signup/90495/1 "2022-09-13T08:27:00Z")

</div>

I’m looking to use Auth0 as a way for new users to sign up to my web app.  
I don’t want to allow anyone to register for this, but only users that bought our hardware.  
1 hardware system can have multiple users.

I was thinking of implementing it via a pre user registration hook.  
Ideally, the user would register, then is prompted for the machine’s serial number, if the SN exists, then they are allowed to complete the registration process.

Is this possible to do with Auth0? And is there a repository of similar embedded functionality?

---

<div class="post-metadata">

**Author:** ![pazel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pazel/32/39897_2.png) [@pazel](https://community.auth0.com/u/pazel)\
**Post date:** [September 13, 2022, 10:22am UTC](https://community.auth0.com/t/restrict-new-user-signup/90495/2 "2022-09-13T10:22:49Z")

</div>

Hi,  
I think you are on the right track with Pre User Registration action.  
If you are using universal login you want to add a new custom field to capture machine’s serial number.  
This information will be available as user metadata later in the action code.

Next step is to call your own api from the action code to verify the machine’s serial number.  
If it’s valid let user through, otherwise deny registration with an error.

Here is a gist on how to customise universal login to get machine’s serial number as part of user registration.

> <https://gist.github.com/pazel-io/c0f9167afcebe3a573c2571881cbeada>

Read the full guide here for customising login form here.

> **[Custom Signup](https://auth0.com/docs/libraries/custom-signup)**
>
> How to customize the user signup form with additional fields using Lock or the Auth0 API.

And here is a sample action page imagining your use case. The code is not tested but should be close to what you need.

> <https://gist.github.com/pazel-io/b496fa29176f9e6fa1f5f770e817f804>

---

<div class="post-metadata">

**Author:** ![da.ente](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/da.ente/32/33194_2.png) [@da.ente](https://community.auth0.com/u/da.ente)\
**Post date:** [September 15, 2022, 11:50am UTC](https://community.auth0.com/t/restrict-new-user-signup/90495/3 "2022-09-15T11:50:03Z")

</div>

wow, pazel, thank you so much for this!

I’m gonna start playing around with this and let you know how it went

---

<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:** [May 14, 2024, 2:11pm UTC](https://community.auth0.com/t/restrict-new-user-signup/90495/4 "2024-05-14T14:11:46Z")

</div>

Hey team!

This topic seems related to our new EA feature, Forms for Actions, which rolled out of the beta stage on May 7th. Our Product team prepared the whole Documentation page with examples of Use cases. [Forms for Actions](https://auth0.com/docs/customize/forms). If you find yourself having questions regarding this new feature for the next two weeks, we are hosting an [Ask Me Anything session](https://community.auth0.com/t/auth0-community-ask-me-anything-customize-and-extend-ciam-with-new-forms-for-actions/133516). Our Product Expert will provide comprehensive written answers on May 21st from 8 AM to 10 AM PST.  
Find out more about [Forms for Actions](https://auth0.com/docs/customize/forms) and [learn more about AMA](https://community.auth0.com/t/auth0-community-ask-me-anything-customize-and-extend-ciam-with-new-forms-for-actions/133516).

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 21, 2024, 10:54pm UTC](https://community.auth0.com/t/restrict-new-user-signup/90495/5 "2024-11-21T22:54:37Z")

</div>

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