函数"/>
FirebaseNodeJS:函数
我正在尝试根据我的函数文件中的电子邮件地址获取用户的 uid:
admin.auth().getUserByEmail("[email protected]")
.then(function(userRecord) {
response.json({
uid: userRecord.getUid(),
})
console.log("Successfully fetched user data:", userRecord.toJSON());
但是在我的函数日志中 -
Error fetching user data: TypeError: userRecord.getUid is not a function
我的 console.log 对 userRecord.toJSON 没问题,但我正在尝试将 uid 返回到前端。有什么建议么?我错过了什么,因为这应该有效吗?
回答如下:您必须使用
uid
的
UserRecord
属性。
response.json({
uid: userRecord.uid,
})
更多推荐
FirebaseNodeJS:函数
发布评论