How to allow same email registrations when different authMethods are used?

My app has 3 ways to register/log in => email, Google, and Facebook.

However, if I register using Google auth, then I can’t register a new account using Facebook auth, because they share the same email.

I get the 203 error.

Is it possible to allow duplicate emails so that the user would create different accounts using different auth methods even if they share the same email address?

The fields email and username are each have a unique index in Parse Server, so they can’t occur twice in the _User class.

However, a user should be able to associate multiple auths with the same Parse user. In other words, a user can have an account which is associated with a single email address, a Facebook and a Google account.

1 Like

Thank you. I made a separate email column to store the emails from social registrations. Because it’s different from the inbuilt field a user can have multiple accounts even if they share the email.

I think this should be more efficient than storing all auth data in the same object because the DB is going to send less traffic when one of the authData fields is requested, if there are 2 separate records.

If I’m not mistaken they are actually separate entries. There is no field authData in the DB, it’s a synthesized field. Server internal auth data queries are likely already per auth type. Only if you request the full authData field are they all fetched and synthesized.

1 Like