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

Make AuthWrapper independent of the recipe name

Open rishabhpoddar opened this issue 4 years ago • 0 comments

Right now, auth wrappers are called based on the name of their recipe. Like <EmailPasswordAuth>, or <ThirdPartAuth>.

This adds extra code and extra docs - both of which require more time to make.

Instead, we should:

  • Have one component like:
    import {SuperTokensAuth} from "supertokens-auth-react";
    
    <SuperTokensAuth>
       <Dashboard />
    </SuperTokensAuth>
    
  • SuperTokensAuth will work only for Auth recipes (not session, not email verification)
  • SuperTokensAuthwill need to detect which Auth recipe is being used.
  • We can keep the current auth wrappers and mark them as deprecated for backwards compatibility.

Problems

  • Edge case: What if multiple auth recipes are being used, then which one should be redirected to on sign out / session expiry?

rishabhpoddar avatar Jul 06 '21 20:07 rishabhpoddar