Abort User Creation with user.create:before Hook

Hi there,

is it possible to avoid the creation of a user with the user.create:before hook? Or is another hook required to abort the creation?

I want to check some json-Data before user signs in with oAuth (user is created if oAuth is successful). If json-data is undefined, the user creation should be aborted.

Thanks for the help.

Why do you need to do this via a hook? If OAuth is successful, and before you create the user, you can check if the data is undefined or not? But you could throw an exception from your hook which should then terminate the process.

The oAuth itself does not return the necessary information to deal with that.

But i found out, that throwing an exception, does the trick :wink: