https://supertokens.com/ logo
Title
j

JJ-WUZO

03/06/2023, 5:25 PM
Hello! I am trying to implement the flow below. A user provides an email or phone number, then it must be validated (OTP), then the user can setup a password. It seems that if I use passwordless recipe the user gets the auth method "Passwordless" and it cannot be changed, therefore it won't ask for a password. Is there any way to implement that authentication flow? Thanks for your help!!
d

dbottisti

03/06/2023, 7:37 PM
One idea would be to set something up similar to the "invite only" flow described here: https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/disable-sign-up/overview. If you're not using third-party providers, then just the "Changes to email password flow" section would apply.
It shows you how to verify the email first (using a link) and then ask the user for a password. You can use this as a start point for what you want to do
j

JJ-WUZO

03/06/2023, 10:22 PM
Hi! Thanks you! I'll give it a try
Hi, thanks for the links below, they've been VERY helpful. I have been able to implement the authorisation workflow. However, when I have started to do the second part (OTP), I have looked at the react code and it seems to be using createAndSendCustomEmail which I believe in Python is create_and_send_custom_email. Do you have any example for python? Unfortunately I am not very clear on how to use it, so any example will be very welcome! Thanks!
r

rp

03/07/2023, 6:58 PM
We don’t have similar examples for python. Sorry. Instead of using this function, you should checkout the email delivery section in our docs and use the newer functions. The createAndSendCustomEmail function in the example app is deprecated
j

JJ-WUZO

03/13/2023, 12:57 AM
Hi, I have another question about email verification... I have found this (https://supertokens.com/docs/thirdparty/common-customizations/email-verification/changing-email-verification-status) page about changing email verification status, but it seems the documentation is not available yet. Do you have any repo/link that can guide me on how to do it?
r

rp

03/13/2023, 7:07 AM
which backend sdk are you using?
j

JJ-WUZO

03/13/2023, 8:51 AM
I'm using Python
r

rp

03/13/2023, 8:52 AM
you can use the
create_email_verification_token
and then the
verify_email_using_token
function. Or the
unverify_email
function.
j

JJ-WUZO

03/13/2023, 9:32 AM
Thanks!
worked like a charm! Thanks