Using the pre-registration hook I can fetch all the users by email, then I can raise an error to prevent registration if the user already exists with that email address.
When user signup using Twitter, his email is not set as the default user’s email.
So my solution using the pre-hook registration to get a user by email works for Facebook and Google but failed on Twitter due to the issue mentioned above.
I do manage to save email which I received from Twitter in UserMetadata.
- Is there another way to deal with that problem?
- Is there a way to get user by his user_metadata properties easily using the management API?