Firebase 的 Cloud Functions 可以在用户登录时执行吗? [英] Can Cloud Functions for Firebase execute on user login?
问题描述
我看到了如何在创建用户帐户时执行云函数:
I see how execute a Cloud Function on user account creation:
exports.myFunction = functions.auth.user().onCreate(event => {
但我需要在用户登录时执行我的函数.是否有 onLogin
触发器?
But I need my function to execute when the user logs in. Is there a onLogin
trigger?
有 1500 分的人可以为 firebase-cloud-functions
创建标签吗?
And can someone with 1500 points create a tag for firebase-cloud-functions
?
推荐答案
登录没有事件,因为只有客户端才能准确定义登录发生的时间.不同的客户可能以不同的方式定义它.如果您需要在登录时触发某些内容,请确定该点何时在您的应用中,然后通过数据库或 HTTP 函数从客户端触发它.
There's no event for login, because only the client side can define exactly when a login happens. Different clients may define this in different ways. If you need to trigger something on login, figure out when that point is in your app, then trigger it from the client via a database or HTTP function.
这篇关于Firebase 的 Cloud Functions 可以在用户登录时执行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!