supertokens-node icon indicating copy to clipboard operation
supertokens-node copied to clipboard

Disable ThirdPartyEmailPasswordNode email sign up via boolean flag

Open n1ru4l opened this issue 3 years ago • 0 comments

There is a disableEmailPassword option for ThirdPartyEmailPasswordReact.init call from supertokens-auth-react/recipe/thirdpartyemailpassword.

I expected there to be a counterpart for the ThirdPartyEmailPasswordNode.init call from supertokens-node/recipe/thirdpartyemailpassword.

The recommended way on the backend is to use ThirdPartyNode from supertokens-node/recipe/thirdparty in case you don't want to allow email/password sign-ups.

However, we enable social logins and email/password login dynamically based on setting environment variables. This makes our code more complicated as we need to initialize different classes based on the application configuration. For us, it would be more convenient to also have a disableEmailPassword option that can be passed to ThirdPartyEmailPasswordNode.init.

A workaround is to instead define overrides for the emailPasswordSignUp and emailPasswordSignIn functions and raise an exception.


Original Thread on Discord: https://discord.com/channels/603466164219281420/644849840475602944/1032553684242018364

n1ru4l avatar Oct 20 '22 07:10 n1ru4l