使用临时密码的 Firebase 电子邮件验证

Firebase email-verification with temporary password

我有一个 React 应用程序,运动队可以在其中注册。 一个团队有一个教练,那个教练应该可以邀请 他的团队成员通过电子邮件。

我已经通过表格设置了教练创建团队成员 设置临时密码的地方

onSubmit 我调用的表单

    auth.createUserWithEmailAndPassword(data['email'],
      generateRandomPassword()) 
    .then(user => user.sendEmailVerification())

这一切都很好,工作起来很有魅力,但我似乎无法想出一个 hack 来让我用电子邮件发送密码,因为电子邮件模板的编辑在 "Firebase Console" 中是灰色的.

除了教练告知每位成员各自的密码之外,还有谁能想出解决此问题的方法吗?

我会 send a password reset email, which contains a token that allows the recipient to reset the password. That means you can safely assume that a user who signs in has received this email and this verified their email address. So you can use the Admin SDK to set their emailVerified property.