Users may forget the initial method they used to sign up and may accidentally create multiple accounts with the same email ID - leading to a poor user experience. Preventing this from happening is called account deduplication.
As an example, let's say that your app has Google and GitHub login. There exists a user who had signed up with Google using their email ID -
firstname.lastname@example.org. If this user then tries to sign up with GitHub which has this same email (
email@example.com), then your app will disallow this and show them an appropriate message like "Your account already exists via Google sign in. Please use that instead."
Related to this problem is also the concept of account linking. The difference is that whilst deduplication prevents duplicate sign ups, account linking allows duplicate sign ups, but implicitly merges the duplicate accounts into one.
In this section of the docs, we will see how you can easily implement account deduplication using SuperTokens.