Skip to content
Back

how to use updatePhone with user created using 0Auth2 providers like google, Facebook.etc

  • 1
  • Users
  • Flutter
  • Cloud
  • Accounts
kamal.panara
19 Jun, 2023, 08:54

I’m working with Appwrite in flutter. And used 0Auth2 provider and updatePhone method with it. Now I’m stuck this because it needs 2 parameters phone and password. Now user doesn’t have password if it’s created with 0Auth2 provider.

P.S I’m completely new to Appwrite so please help me how to do this.

TL;DR
The user wants to use the updatePhone feature with users created using OAuth2 providers like Google or Facebook. However, it is not possible to add a phone number to an account created with OAuth. To work around this, the user can create a user document when they sign up and store their phone number in that document. Unfortunately, the updatePhone method requires both a phone number and a password, so it cannot be used in this scenario. There is currently no solution to verify a phone number with SMS when using OAuth.
safwan
19 Jun, 2023, 08:58

Are you using appwrite cloud?

kamal.panara
19 Jun, 2023, 09:01

yes

safwan
19 Jun, 2023, 09:04

Going through the docs, looks like it's not possible to add a phone number to an account created with OAuth

safwan
19 Jun, 2023, 09:04

What you can do is create a user document when they sign up, and store their phone number in that

kamal.panara
19 Jun, 2023, 09:05

then how can i verify it with sms?

safwan
19 Jun, 2023, 09:07

you can't use phone auth and oauth together

safwan
19 Jun, 2023, 09:07

only one

safwan
19 Jun, 2023, 09:08

if a user signs up with their google account for example, i don't see why they'd need to login with phone as well 😅

kamal.panara
19 Jun, 2023, 09:11

the yea, I don't want them to log in with the phone, I just want to store their number after verifying it with sms. that's why I used updatePhone method instead of createPhoneSession after that according to docs we can verify that phone later when we need it.

kamal.panara
19 Jun, 2023, 09:13

and to use updatePhone method we need user's password which is where i'm stuck

Drake
19 Jun, 2023, 19:42

We're going to be improving this (https://github.com/appwrite/appwrite/pull/5621)... unfortunately, right now, they would need to reset their password using the create recovery api

kamal.panara
23 Jun, 2023, 12:18

when will be this in production?

Drake
23 Jun, 2023, 14:30

it will probably be a while before it gets to cloud

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more