在 Flutter 中使用 firebase 身份验证进行电子邮件 OTP 验证

Email OTP verification with firebase authentication in Flutter

默认情况下,firebase 会发送一个 link 来验证用户电子邮件,但我想用该电子邮件发送一个 otp。那么有没有一种方法可以自定义该电子邮件或发送一个 otp,然后一旦用户在应用程序上输入了正确的代码,就让 Firebase 将该用户帐户标记为已验证的电子邮件?

您所描述的实际上是默认 Firebase 流程的作用:它发送一封带有 link 的电子邮件,其中包含用于验证电子邮件地址的 OTP。

你可以做一定数量的customization of the email action handler page that the emails link to. If that is not enough, you will have to implement your own flow, and can then use the Admin SDK in a secure environment to mark the user's email as verified