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.

Need for canLinkAccounts and canCreatePrimaryUserId

Status:
accepted
Deciders:
rishabhpoddar, bhumilsarvaiya
Proposed by:
bhumilsarvaiya
Created:
2022-11-29

Context and Problem Statement#

Do we really need canLinkAccounts and canCreatePrimaryUser functions? On a recipe level and on a index.ts level (exposed to the user)?

Considered Options#

  • Not expose either of the functions
  • Expose both the functions but make them not overridable
  • Expose both the functions and make them overridable

Decision Outcome#

Chosen option: Expose both the functions and make them overridable, because

  • User may want to use these functions while performing some custom logic
  • By design, we allow users to override the functions exposed by recipe interface. We don't want to change that so these functions will be overridable

Additional details, etc.

Pros and Cons of the Options#

Not expose either of the functions#

  • What if the user wants to use these functions in their custom logic somewhere
  • Expose both the functions but make them not overridable#

  • By design, we allow users to override the functions exposed by recipe interface. We don't want to change that so these functions will be overridable
  • Expose both the functions and make them overridable#

  • User may want to use these functions while performing some custom logic
  • By design, we allow users to override the functions exposed by recipe interface. We don't want to change that so these functions will be overridable