# Pre-registration hooks : send feedback to user

**URL:** <https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048>\
**Category:** Get Help\
**Tags:** signup, hooks\
**Created:** [March 9, 2020, 11:14am UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048 "2020-03-09T11:14:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkernevez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pkernevez/32/19572_2.png) [@pkernevez](https://community.auth0.com/u/pkernevez)\
**Post date:** [March 9, 2020, 11:14am UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/1 "2020-03-09T11:14:24Z")

</div>

Hi,

I created a Pre-Registration hook.  
I have a rule that refuse de user creation (duplicated user).  
In case of error, I use the following code to reject the creation :  
cb(users.length + ’ account(s) already exists ’ null, context);

But the user doesn’t receive any explaination about the failure :

 ![image](https://global.discourse-cdn.com/auth0/original/3X/9/8/9807815351212b5464de06a523d904cc1d4f35fe.png)

How can I explain to the user why his account isn’t created ?

Regards,  
Philippe

---

<div class="post-metadata">

**Author:** ![pkernevez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pkernevez/32/19572_2.png) [@pkernevez](https://community.auth0.com/u/pkernevez)\
**Post date:** [March 9, 2020, 11:26am UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/2 "2020-03-09T11:26:41Z")

</div>

It’s not a new question, but I didn’t found any answer…  
[http://community.auth0.com/t/how-to-return-error-from-auth0-hooks/6327/14](http://community.auth0.com/t/how-to-return-error-from-auth0-hooks/6327/14)

---

<div class="post-metadata">

**Author:** ![mathiasconradt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mathiasconradt/32/12758_2.png) [@mathiasconradt](https://community.auth0.com/u/mathiasconradt)\
**Post date:** [March 9, 2020, 12:25pm UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/3 "2020-03-09T12:25:16Z")

</div>

The Hooks currently don’t allow to return a proper customized error message; when a Hook fails, it just returns a generic 500 http status with a generic error message (“An error occured”). Therefore, **Hooks can’t currently be used properly for such kind of input validation.**

But we are aware of the limitation and the product team is discussing this internally, so custom error messages will most likely be supported in the future at some point. But for now, it’s not possible.

---

<div class="post-metadata">

**Author:** ![pkernevez](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pkernevez/32/19572_2.png) [@pkernevez](https://community.auth0.com/u/pkernevez)\
**Post date:** [March 9, 2020, 2:03pm UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/4 "2020-03-09T14:03:56Z")

</div>

The requirement is present on the forum for more than 2 years and are quite popular threads.  
“At the Pre User Registration extensibility point, Hooks allow custom actions to be executed when a new user is created. For example, you may add custom `app_metadata` or `user_metadata` to the newly-created user, or even **prevent the creation of the user in the database**.”  
It’s hard to understand that we can prevent a user request but not give him feedback…

---

<div class="post-metadata">

**Author:** ![mathiasconradt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mathiasconradt/32/12758_2.png) [@mathiasconradt](https://community.auth0.com/u/mathiasconradt)\
**Post date:** [March 9, 2020, 4:09pm UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/5 "2020-03-09T16:09:33Z")

</div>

Yes, I totally understand. However, there are many other feature requests in the product log, including those that don’t up in the community forum. The demand is definitely measured, but of course it’s not just based on community forum posts popularity, but also other factors. But I totally understand that it would be helpful to have this, and of course the sooner the better.

---

<div class="post-metadata">

**Author:** ![simon.wilder](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/simon.wilder/32/12822_2.png) [@simon.wilder](https://community.auth0.com/u/simon.wilder)\
**Post date:** [May 22, 2020, 10:49am UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/6 "2020-05-22T10:49:52Z")

</div>

Now that Hooks are about to leave beta @mathiasconradt, will this feature be part of the release?  
I’m asking as it is also very important to us.

---

<div class="post-metadata">

**Author:** ![mathiasconradt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mathiasconradt/32/12758_2.png) [@mathiasconradt](https://community.auth0.com/u/mathiasconradt)\
**Post date:** [June 29, 2020, 7:13am UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/7 "2020-06-29T07:13:36Z")

</div>

Update: customizing the hook error messages is now possible, see [https://auth0.com/docs/hooks/extensibility-points/pre-user-registration#sample-script-customize-the-error-message-and-language-for-user-messages](https://auth0.com/docs/hooks/extensibility-points/pre-user-registration#sample-script-customize-the-error-message-and-language-for-user-messages)

---

<div class="post-metadata">

**Author:** ![onzali](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/onzali/32/22714_2.png) [@onzali](https://community.auth0.com/u/onzali)\
**Post date:** [July 22, 2020, 10:38pm UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/8 "2020-07-22T22:38:05Z")

</div>

Hi @mathiasconradt, we have followed the example given in the link above but we still see the generic message "WE’RE SORRY, SOMETHING WENT WRONG "

---

<div class="post-metadata">

**Author:** ![mathiasconradt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mathiasconradt/32/12758_2.png) [@mathiasconradt](https://community.auth0.com/u/mathiasconradt)\
**Post date:** [June 7, 2021, 5:35am UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/9 "2021-06-07T05:35:33Z")

</div>

@onzali Sure you’re using the New ULP and not the Classic one?

See docs:

> **[Explore Flows and Triggers](https://auth0.com/docs/customize/actions/flows-and-triggers)**
>
> Learn about triggers, which are events that automatically invokes an Action when a specific operation, such as a user logging in, occurs at runtime.

> To return the user message and use the translation functionality, your tenant must be configured to use the new universal login.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [January 8, 2024, 10:42am UTC](https://community.auth0.com/t/pre-registration-hooks-send-feedback-to-user/39048/10 "2024-01-08T10:42:44Z")

</div>

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next [Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team](https://community.auth0.com/t/auth0-community-ask-me-anything-rules-hooks-and-why-actions-matter/124043) on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

[Learn more here!](https://community.auth0.com/t/auth0-community-ask-me-anything-rules-hooks-and-why-actions-matter/124043)
