用户更新电子邮件时的Firebase auth onUpdate云功能 [英] Firebase auth onUpdate cloud function for when a user updates their email
问题描述
每当我的用户更新其电子邮件地址时,除了auth仅具有onCreate和onDelete之外,我都需要运行Firebase函数.我如何对电子邮件更新做出反应?
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.
您可以通过让您的应用监听身份验证事件(传递给您的侦听器的用户对象,然后将该用户的电子邮件地址写入该用户的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屋!