Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove Phone Number from user account in firebase?

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

like image 289
Taylor Austin Avatar asked Jan 23 '18 15:01

Taylor Austin


1 Answers

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

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

like image 69
bojeil Avatar answered Sep 21 '22 11:09

bojeil