How to use Auth uid that store from firebase and update Auth user information such as change password, email and phone number? I have upload Auth ID into the firebase, then I trying to use snapshot to get the Auth id and apply into the firebase.auth to update the information from auth, but it comes with error.
firebase.database().ref('users/Admin/'+id).once('value').then(function (snapshot){
var Authid = snapshot.val().AuthId;
console.log(Authid);
firebase.auth().updateUser(Authid,{
email: email,
password:password,
phoneNumber:phone,
}).then((userRecord) => {
// See the UserRecord reference doc for the contents of userRecord.
console.log('Successfully updated user', userRecord.toJSON());
console.log(Authid);
})
.catch((error) => {
console.log('Error updating user:', error);
});
});