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.
Summary
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
Jan 24, 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)