supertokens-auth-react icon indicating copy to clipboard operation
supertokens-auth-react copied to clipboard

Clean up props structure that is passed to theme from feature

Open rishabhpoddar opened this issue 4 years ago • 0 comments

Ideally, we should only have to pass:

  • RecipeImplementation
  • Recipe Config
  • Success callbacks

A high level design principle for this is that if someone wants to customise the behaviour of a component that uses the props, they should be able to do so with maximum flexibility.

For example, if a button click calls an API and based on the response shows an error or does redirection, that should be done via two functions and not one - so that the user can choose to skip showing the error and do redirects anyway. (This is the case of email OTP recipe in case when on sign in, if an email doesn't exist, we show an error else redirect. But someone may want to redirect anyway) - See side note in this comment: https://github.com/supertokens/supertokens-core/issues/253#issuecomment-859999241

rishabhpoddar avatar May 29 '21 10:05 rishabhpoddar