Hi there!
I've just come from your very helpful Twilio verification tutorial on YouTube. While that part has been explained wonderfully, I'm confused as to whether SMS OTP verification is definitely required if I were to implement Twilio for my login/sign up method. Ideally I would like the user to be able to choose between logging in/registering as a Site Member using email address OR phone number.
I have read Wix's documentation on this but any extra information would be extremely appreciated as my client is concerned about Twilio's charges. Thank you!
Hi!
There are two (and possibly more) approaches you can take to registering users with Twilio -
Register using the Wix members API and generate a random fake email address to pass to the register() function (as email is required). You can then have a sperate collection which tracks the association between phone numbers and fake email addresses for login purposes.
Manage the membership yourself in a collection and use generateSessionToken() each time you want to log in a member.
Either way you could have people signing up and logging in both with email and phone numbers.
Good luck!