【发布时间】:2021-05-06 05:28:48
【问题描述】:
如何使用从 firebase 存储的 Auth uid 并更新 Auth 用户信息,例如更改密码、电子邮件和电话号码?我已将 Auth ID 上传到 firebase,然后我尝试使用快照获取 Auth id 并应用到 firebase.auth 以更新来自 auth 的信息,但它带有错误。
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);
});
});
【问题讨论】:
-
嘿云松。你有没有得到任何地方?我试图在下面提供答案。你看到了吗,它有意义吗?
标签: javascript firebase firebase-realtime-database firebase-authentication