问题
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