Back

queries

  • 0
  • Flutter
Lackson Munthali
24 Jan, 2024, 10:36

I want users to be able to create accounts using their phone number and login using phone number just like WhatsApp does it. How can I achieve this with app write. createPhoneSession is for registering a user. What method should I use to login an existing user cause createPhoneSession requires phone number and userId? Do I have to pass a unique userId every time a user wants to login.

TL;DR
Title: Creating Phone Number Authentication with Appwrite Summary: The developer wants to implement phone number authentication, similar to WhatsApp, using Appwrite. They are unsure of the methods to use for registration and login, as well as how to handle user identification. Solution: To achieve phone number authentication with Appwrite, the developer can use the `createPhoneSession` method for both registration and login. If a user with the provided phone number doesn't exist, Appwrite will create a new user. No need to pass a unique userId every time a user wants to login. The same logic and UI can be used for both authentication and signup.
kamal.panara
24 Jan, 2024, 10:47

Hi @Lackson Munthali , you just need to use createPhoneSession for creating new session (login), if user with phone doesn't exists then appwrite will create new. so basically what you are doing right now is correct, and you can use same logic and same screen/UI for authentication (login + sign up)

Lackson Munthali
24 Jan, 2024, 10:51

Thanks for the help @kamal.panara

kamal.panara
24 Jan, 2024, 10:53
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