Skip to main content
important

This is a contributors guide and NOT a user guide. Please visit these docs if you are using or evaluating SuperTokens.

Email verification should do account linking even in optional mode

Status:
accepted
Deciders:
rishabhpoddar, bhumilsarvaiya
Proposed by:
rishabhpoddar
Created:
2022-12-01

Context and Problem Statement#

If email verification is in OPTIONAL mode, post email verification, should we do automatic account linking?

Considered Options#

  • We should do automatic account linking
  • We should not do automatic account linking

Decision Outcome#

Option chosen: We should do automatic account linking

The behaviour for automatic account linking will be the same as if email verification was in REQUIRED mode. Note that the dev can disable this if they want by providing their custom implementation to the shouldDoAccountLinking function

Pros and Cons of the Options#

We should do automatic account linking#

  • If the dev has implemented proper migration steps in postAccountLink callback, the end user will have a better experience
  • If the dev has not implemented proper migration steps in postAccountLink callback, then there might be loss of user data when their account is linked. But we will encourage devs to implement that callback, so it should be fine.
  • We should not do automatic account linking#

    Inverse of the above list.