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

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

问题描述

每当我的用户更新其电子邮件地址时,除了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.

您可以通过让您的应用监听身份验证事件(数据库触发器来跟踪用户在数据库,然后对那里的更改做出反应.

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天全站免登陆