I have been using this code for a year now:
firebase.auth().createUserWithEmailAndPassword(textUser, textPassword) .then(function(user){ console.log(\'uid\',use