Hi there! I'm planning to launch my app before the end of the month and I'm trying to implement a re...
d
Hi there! I'm planning to launch my app before the end of the month and I'm trying to implement a referral system, where new users can sign up only with an invitation code. My app is using the ThirdPartyPasswordless recipe, and contrary to the EmailPassword recipe, there's no Sign Up flow on which I can add another required field when signing up. As of now, I'm creating manually new users for my beta testers, and I'm denying signup if I can't find any matching email/phone in a
createCodePOST
API function override. I was thinking about exposing a route on my application to validate an invite code, in which the route would create a new user on Supertokens, hence enabling this email to sign in. However, in that setup, there's no way to verify the provided email authenticity, except if I implement email validation on my own, which isn't something I want to do. Can you think of other ways to implement that? Is that something that could be integrated within my Supertokens setup or should I think about this being outside of Supertokens' scope? I understand this is a kind of specific use case, and might not even be related to Supertokens, but still I'd love to hear your input on this 🙂
r
Hey @darkchipolata
The best way to do this would be to pass the invite code as property in the request body for the consume code API and for the signinup (third party login) API.
Then override those APIs on the backend to check if the email already exists for the sign up method, and if not, check the invite code.
d
Awesome, will try!