我想获取新创建的用户的用户ID,以便可以将我的文档命名为该uid,但它表示为空。
这是我的代码
addDriver(){
var $this = this
secondaryApp.auth().createUserWithEmailAndPassword($this.driver.email,$this.driver.password).then(function(user){
$this.$db.collection("driver").doc(user.uid)
.set({
fname: $this.driver.fname,lname: $this.driver.lname,contact_number: $this.driver.cnum,license_number: $this.driver.license,email: $this.driver.email,password: $this.driver.password,})
secondaryApp.auth().signOut();
$this.formHeaderStatus = $this.$db.auth().currentUser
})
},
我也正确吗?我以管理员身份登录?而且我想创建一个新用户而不注销自己。