I am using firebase and mongodb atlas. I have saved social media login credentials like email, name, picture in mongodb users collection. but I am unable to save phone login credentials like phone number and uid. when I login into app using social login, I am getting id like the below image.
but when I login into app using phone number, I am unable to get id. May be the reason the phone credentials was not saved. How can I get id value at the time of phone login. In Mongodb realm app, we store value like this.
could you please help me with the solution. thanks in advance.
You should use the UID that firebase provides in both cases. All forms of firebase authentication provide this property as this is the way Firebase identifies your users. If you are trying to save the firebase Auth credentials to mongodb, use the UID.
You can find the uid of a social auth provider like this.