How to block User-Email-Password registration for existing Twitter user?

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.

  1. Is there another way to deal with that problem?
  2. Is there a way to get user by his user_metadata properties easily using the management API?

Hi @idan1,

Welcome to the Community!

Account linking would be another way, but it will change your user’s experience. They could log in through any connection type, db, social, etc. and it will be a shared profile. It is a bit more complicated than a simple pre-reg hook, up to you.

You should be able to get it via the user by email endpoint. Have you looked at the docs on that?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.