How to achieve this.
I don't this that there is a direct way to achieve that.
But, what you can do is to create a function to handle this.
Inside of the function use the Users server SDK to get the user https://appwrite.io/docs/server/users?sdk=nodejs-default#usersGet
Now, you can check if the user has only phone, that mean this user was created with a phone.
Then you can use updateEmail to set email for that user.
https://appwrite.io/docs/server/users?sdk=nodejs-default#usersUpdateEmail
So the user will be able to login using email or phone.
will appwrite charge for authencation ?
You mean in the cloud? for the SMS?
yes
Now it's free part of the public beta. I think is going to be some pricing - or at least some limits on the free tier - when it will go public.
Thanks @Binyamin
As of now, we do not have pricing, we will do in future but we are going to definitely have a generous free tier as well @conqueror
[SOLVED] how to to log in with both an email and a phone number on the same account
Recommended threads
- Impossible to get USER after createEmail...
Am using provider to deal with functions linked to appwrite. Here is my login. Future<String?> login(String email, String password) async { try { aw...
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...