Firebase云功能身份验证触发时间 [英] Firebase Cloud Function Authentication Trigger timing

本文介绍了Firebase云功能身份验证触发时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道Firebase Cloud功能onCreate身份验证触发器的时间是什么吗?

Does anyone knows what the timing of the Firebase Cloud Functions onCreate Authentication Trigger is?

是这样的吗?
-用户使用SDK注册
-Firebase在Firebase身份验证中创建用户并为其进行身份验证
-Firebase SDK发送登录成功事件
-调用功能 onCreate

Is it like:
- User registers using SDK
- Firebase creates user in and for Firebase Authentication
- Firebase SDK sends login successful event
- Function onCreate is invoked

或类似:
-用户使用SDK注册
-Firebase在Firebase身份验证中创建用户并为其进行身份验证
-Firebase onCreate 被调用
-Firebase SDK发送登录成功事件

or like:
- User registers using SDK
- Firebase creates user in and for Firebase Authentication
- Firebase onCreate is invoked
- Firebase SDK sends login successful event

或者换句话说:
我可以确定在成功注册用户后,简短的Firebase Cloud Function脚本已经创建了Firestore用户文档吗?

Or in other words:
Can I be sure that after a successful user registration a Firestore User Document was already created by a short Firebase Cloud Function script?

所以我可以确定,当SDK发送成功创建Firestore用户文档的身份验证回调时吗?

So can I be sure that when the SDK send the authentication successful callback that the Firestore user document was created?

推荐答案

您无法保证将事件交付到Cloud Function代码的时间.当然,系统将尝试尽快交付.但事实是,在处理该事件的每个阶段都可能会有不可预测的延迟,因此您不应该依赖任何特定的时间安排.在还要处理也可以异步工作的其他系统(包括Firestore)时,尤其如此(听起来您是在暗示您的函数创建了一个文档,供以后在应用程序中回读).

You are given no guarantees about the timing of the delivery of events to your Cloud Function code. Of course, the system is going to try to deliver as fast as possible. But the fact of the matter is that there can be unpredictable delays at every stage through the processing of that event, so you shouldn't depend on any sort of specific timing. This is especially true when also dealing with other systems that work asynchronously as well, including Firestore (it sounds like you're implying that your function creates a document to read back later in the app).

好消息是,您可以收听文档您希望为用户创建该代码,并在准备好后立即接收它.

The good news is that you can listen to the document that you expect to be created for the user, and receive it whenever it's ready.

这篇关于Firebase云功能身份验证触发时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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