firebase - 是否能够将 Firebase 用户存储到我们自己的数据库中?
问题描述
如果我使用用户注册并通过firebase身份验证登录,则用户信息存储在firebase数据库端。如何获取用户信息(如 FirstName、LastName、Gender 等)并存储在自己的数据库中?是否使用访问令牌调用我的 API 来检查用户身份?
解决方案
我建议在创建用户时使用云功能来触发。
exports.userCreate = functions.auth.user().onCreate((user) => {
const email = user.email; // The email of the user.
const displayName = user.displayName; // The display name of the user.
// Write insert email, displayName, ... to your own database.
});
推荐阅读
- debugging - Chrome 检查视图需要打开才能扩展功能
- python - tensorflow.python.framework.errors InternalError:无法创建会话
- javascript - 如何在电子应用程序中包含 bootstrap 4
- wso2 - WSO2 API Manager 2.2.0 - 如何为其他租户用户启用 grant_type=password?
- javascript - 百分比函数显示空白
- excel - 如何在组合框中制作两列?
- java - 在 2^32 内溢出不会引发 ArithmeticException
- java - JAXB 复杂元素及其同名子元素
- java - 以 HOUR 作为 Calendar 的参数的 getActualMinimum 在 Java 中返回 12
- reactjs - 提示如何在 Reactjs 中渲染时循环