Auth0 Home Blog Docs

Surface Hook exception messages to lock or hosted login page

I have almost the same requirement as this:

I want to validate that the email domain provider during sign up is valid and part of our whitelist. I started by doing this in a rule. The downside to that approach is the user is created in the database because rules do not invoke until after registration. So we would need to perform user clean-up activities that I feel like we should be able to avoid.

Hooks have the ability to be invoked before registration, however when I have my hook return an error the login page is not provided with that error to display. Just as mentioned in my earlier referenced post.

Any solutions or suggestions to my requirement please?