DEV Community

Discussion on: The Complete Guide to User Authentication with the Amplify Framework

Collapse
 
adrienfabre profile image
Adrien Fabre

Hi Nader,

Thank you for this article, it helped me a lot.

I am trying to adapt it, sign up with Google (OAuth) or with Cognito (email + password).

My issue is that if I sign up with Google and then Cognito, I create a duplicate in my User Pool. Also, if I sign up with Cognito and then Google, it also create a duplicate in my User Pool.

However, if I try to sign up twice with Cognito, it would notice the email already exist.

I am trying to find a good way to prevent those duplicate, or by raising an error or by merging the duplicate but I have not found out, would you have suggestions?

Thank you

Collapse
 
rudyhadoux profile image
rudyhadoux

If you use Auth.federatedSignIn({provider: 'Google'}), you don't have to use anything else.
Why twice ?

Collapse
 
indrajitb profile image
indrajitb

Hi rudyhadoux,
If you sign in with Facebook and Google with same email, it creates two identities.
Thanks.

Thread Thread
 
rudyhadoux profile image
rudyhadoux

Two Cognito identities with the same email ?
Is it possible ?

Collapse
 
indrajitb profile image
indrajitb

Hi Adrien,

Did you find a solution to this problem?

Thanks.