
我正在尝试根据我的函数文件中的电子邮件地址获取用户的 uid:
admin.auth().getUserByEmail("[email protected]")
.then(function(userRecord) {
response.json({
uid: Uid(),
})
console.log("Successfully fetched user data:", JSON());
但是在我的函数日志中 -
Error fetching user data: TypeError: Uid is not a function
我的 console.log 对 JSON 没问题,但我正在尝试将 uid 返回到前端。有什么建议么?我错过了什么,因为这应该有效吗?
回答如下:您必须使用
uid的
UserRecord属性。
response.json({
uid: userRecord.uid,
})
本文发布于:2024-05-30 17:21:25,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/1717433453275935.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
| 留言与评论(共有 0 条评论) |