Firebase auth onUpdate 云功能,用于当用户更新他们的电子邮件时 [英] Firebase auth onUpdate cloud function for when a user updates their email

查看:10
本文介绍了Firebase auth onUpdate 云功能,用于当用户更新他们的电子邮件时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我的用户更新他们的电子邮件地址时,我都需要运行 Firebase 函数,除了 auth 只有 onCreate 和 onDelete.我如何对电子邮件更新做出反应?

I need to run a Firebase function whenever my user updates their email address, except auth only has onCreate and onDelete. How can I react to email updates?

推荐答案

目前无法直接响应在 Firebase 身份验证中更改的电子邮件地址.如果您希望将其视为一项功能,请提交功能请求.

It's not possible today to directly react to an email address changing in Firebase Authentication. If you'd like to see that as a feature, please file a feature request.

您可以通过让您的应用监听身份验证事件(Android),取 用户对象 传递给您的听众,并将用户的电子邮件地址写入该用户 UID 的 RealtimeDatabase 位置(或 Firestore 文档).然后,您可以有一个数据库触发器来跟踪您的用户在数据库,并对那里的变化做出反应.

You can react to it indirectly by having your app listen to authentication events (Android), take the User object delivered to your listener, and write the user's email address to a RealtimeDatabase location (or Firestore document) for that user's UID. Then, you can have a database trigger that tracks the location of your users in the database, and react to the change there.

这篇关于Firebase auth onUpdate 云功能,用于当用户更新他们的电子邮件时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆