How to remove Phone Number from user account in firebase?

断了今生、忘了曾经 提交于 2020-04-11 04:12:07

问题


I'm guessing you have to do something with re authing to remove the phone number because at the moment I am trying to do this:

const user = firebase.auth().currentUser;

user.updateProfile({phoneNumber: null}).then(() => { alert('success') }).catch(err => {alert(err)})

this is not working, but I am getting the success block


回答1:


To remove a phone number account from a user, simply unlink it:

firebase.auth().currentUser.unlink(firebase.auth.PhoneAuthProvider.PROVIDER_ID);




回答2:


As stated on the documentation:

You can update a user's basic profile information—the user's display name and profile photo URL—with the updateProfile method.

This means you can only update the user's display name and profile photo. There's also the updateEmail method which can be used to update the user's email. But there's no way to update the phone.



来源:https://stackoverflow.com/questions/48405726/how-to-remove-phone-number-from-user-account-in-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!