Hey, I'm using Twilio phone auth in an app (not th...
# help
a
Hey, I'm using Twilio phone auth in an app (not through Supabase Auth because I'm using WhatsApp verify codes, not SMS OTPs). I want to then create profiles for the user in Supabase and allow user to access the data when phone has been verified. What's a good way to do this? (Essentially the user needs to be able to access their account data once their phone has been verified using Twilio auth without having to authenticate through Supabase as well)
n
Hello @aar2dee2! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
🆕 create user when verified through another auth provider
s
Do you plan to use RLS?
n
create user when verified through another auth provider
a
ideally, yes. The user should be able to see only their data in the profile table
s
Then, you need to use supabase auth too.
What you can do use send OTP, via functions to WhatsApp too, along with sms.
a
this sounds great. So I should make a request to the Twilio client from Supabase itself?
s
Send OTP via twilio and once you get the OTP you use supabase function yo send message via whatsapp
a
thanks for this! trying a different approach - verifying directly through Twilio's Verify service and then signing up on Supabase with phone + password without requiring phone verification again. Is that a secure approach?
s
you wont be able to reset the password
will you login everytime via otp or password?
a
Preferably via OTP
s
then you can use supabase twilio, no need to use twilio independently
a
*WhatsApp OTP
My app requires users to have a valid WhatsApp account. Hence, I need to verify using a WhatsApp code, not an SMS otp
If I verify with Supabase auth, then also send the code on WhatsApp, the user can still sign up whether or not they have an active WhatsApp account
s
okay, got it. it's a hacky solutions, how you will sign in again? you need to remember password for each users? or you will keep some default logic,
a
yea, that's what I'm stuck on. Ideal sign in approach has to be phone + password, but if the user forgets password, I could initiate the phone verification via WhatsApp again and allow password reset (not sure how I'm going to implement this, though)
s
You need to setup the password with some predefined logic which you pass it on later
g
@aar2dee2 did u end up figuring out a good solution for this?