The only Authentication triggers that are available for Cloud Functions are when the user account is first created, and when it gets deleted.(Cloud Functions唯一可用的身份验证触发器是在首次创建用户帐户时以及在删除用户帐户时。)
There is no trigger to run a function when an email gets added or verified, not when two identity providers are linked to the same account.(添加或验证电子邮件时(没有将两个身份提供者链接到同一帐户),没有触发运行功能的触发器。)
The standard way to do what you want is to use another trigger type (such as a callable function as you already said), validate in there that the user is indeed entitled to the custom claim, and then add that claim to their profile.(执行所需操作的标准方法是使用另一种触发器类型(例如您已经说过的可调用函数),在其中验证用户确实有权获得自定义声明,然后将该声明添加到他们的个人资料中。) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…