Customise hosted login page to redirect elsewhere for a given email domain

I use a hosted login page, and I’d like to do the following:

When the user enters their email address (or when they click log in), if their email address is for a certain domain, I want to redirect them to a different page.

I’ve found the hosted login page customisation options in the Auth0 dashboard, and I can see that it’s using Auth0 Lock. I looked in the Lock documentation to see if there’s any way to provide a Javascript function to intercept the authentication process at any point, e.g. when they click “log in”, but I can’t see any such option. Is this possible?

I think you need to use rules for that. This should get you going in the right direction: