Welcome to the Auth0 Community!
As mentioned in this community post, redirecting an user using the PreUserRegistration
Trigger is not possible and only has the api.access.deny(reason, message)
function available to deny access to the application.
Otherwise, redirection is possible using a PostLogin
Trigger in order to deny the user access to the application. The only issue would be, as in the mentioned community:
Understandably, this will prevent user login and increment the number of users in your database, which may warrant some degree of grooming. However, this will not affect your MAU (Monthly Active Users) count since these users never successfully “logged in”.
Denying access using a PostLogin
trigger would still create the user within Auth0, meaning that you would need to use the Management API to delete the user if you do not wish them to exist within the connection used.
If you have any other questions, let me know!
Kind Regards,
Nik