zach_h9554
03/19/2022, 1:32 AMrp_st
03/19/2022, 4:20 AMzach_h9554
03/19/2022, 5:51 PMrp_st
03/19/2022, 7:32 PMemailPasswordSignUpPOST
API function (API for signing up with email and password): https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/apis-override/disabling
- Override the thirdPartySignInUp
recipe function (see https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/backend-functions-override/usage) -> the input to the function has the email ID of the user who is trying to sign up. Use that to check if it's already a user by calling ThirdPartyEmailPassword.getUsersByEmail(..)
-> If this returns an array of size 0, then throw an error which will disallow sign up, else call the orginal implementation (signing in the user).rp_st
03/19/2022, 7:32 PMzach_h9554
03/20/2022, 2:45 PMzach_h9554
03/20/2022, 2:45 PMzach_h9554
03/20/2022, 2:49 PMrp_st
03/20/2022, 2:51 PMThirdPartyEmailPassword.getUsersByEmail(..)
returns a non empty list back (indicating this user already exists in your system).zach_h9554
03/20/2022, 2:51 PMzach_h9554
03/20/2022, 2:54 PMzach_h9554
03/20/2022, 2:57 PMzach_h9554
03/20/2022, 2:57 PMrp_st
03/20/2022, 2:57 PMzach_h9554
03/20/2022, 2:58 PMrp_st
03/20/2022, 3:00 PMThirdPartyEmailPassword.getUsersByEmail(..)
too. If this returns a non empty array, it means they are already registered. So you should then call the original impl allowing them to sign in.
So people using social login would not be able to login if and only if ThirdPartyEmailPassword.getUsersByEmail(..)
returns an empty array (for their email), AND, you have not whitelisted their email in some list stored in your db.zach_h9554
03/20/2022, 3:02 PMrp_st
03/20/2022, 3:02 PMzach_h9554
03/20/2022, 3:02 PMrp_st
07/07/2022, 2:34 PMbirdinadream
07/07/2022, 2:50 PMrp_st
07/07/2022, 2:52 PMzach_h9554
11/30/2022, 7:39 PMinput
doesn't have the email the user tried to sign in/up with so I can't do a conditional check before supertokens creates the user + session, which is undesirable (I think). Is there a way to extract the user email from the input
without using consumeCode
first?rp_st
11/30/2022, 7:46 PMzach_h9554
11/30/2022, 7:47 PM