
I'm using appwrite cloud. In my app I'm logged in with google provider. When I execute createPhoneSession providing current session userId it throws "Server Error"

What's your project id?

Are you trying to create createPhoneSession
while the user is logged in?

647de70a6139cddef6d2

yes

The function is intended to be used to login the user.

Can you elaborate about your use case?

My use case is that I need to log in user with google and then verify with phone

For that I think you shuold use createPhoneVerification
https://appwrite.io/docs/client/account?sdk=web-default#accountCreatePhoneVerification

(after calling update phone to set the phone number)

account.updatePhone(phone, password); what is password?

With this endpoint you can update the user phone number.

So the flow will be
updatePhone
createPhoneVerification
updatePhoneVerification

You can also add the phone number without a password using a Server side SDK https://appwrite.io/docs/server/users?sdk=nodejs-default#usersUpdatePhone

Since the user was created with oauth, they may need to go through the reset password flow to set their password...we plan on changing this in 1.4 such that you wouldn't need to pass a password

Appwrite function and server SDK might be a good approach to update the phone without requiring password

client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ;
what is that secret API key ?

To use the Server side SDK You should use Appwrite functions for that https://appwrite.io/docs/functions
Inside Appwrite function you get higher level of access with an API key https://appwrite.io/docs/keys
Recommended threads
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
