firebase - Google Firebase和Flutter公司的电子邮件仅在注册时使用

标签 firebase flutter dart firebase-realtime-database google-cloud-functions

我让Google Flutter移动了Firebase功能,OAuth和DB,我希望所有新用户只能通过公司电子邮件(而不是Hotmail或Gmail等)进行注册。首先,这应该通过Firebase DB规则,功能来完成还是应该在移动应用中使用Google Dart进行注册吗?
如果是的话,是否有人共享一些代码示例,或者如何做到这一点?

最佳答案

您必须在应用程序规则和数据库规则中强制执行公司电子邮件,以提供良好的体验并提供安全性。
了解Firestore安全规则的起点:
https://fireship.io/snippets/firestore-rules-recipes/
对于数据库规则,请使用match:
https://firebase.google.com/docs/reference/rules/rules.String#matches
和正则表达式:
How to validate an email address using a regular expression?

关于firebase - Google Firebase和Flutter公司的电子邮件仅在注册时使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63581213/

相关文章:

string - 如何在 Flutter 中将列表转换为字符串?

flutter - 有什么方法可以为CupertinoApp实现debugShowMaterialGrid吗?

php - 来自服务器端 Firebase + PHP 的电话身份验证验证

widget - Flutter Inspector Toggle Select Widget 模式不起作用。

javascript - react JS : How to pass emoji to Firebase real-time db - why is it showing as object?

flutter - 试图在Flutter中在YoutubePlayerBuilder中使用ListView

dart - 如何检查两个 map 在 Dart 中是否相等

dart - 禁止有关使用 protected 成员的提示

ios - 使用 Swift 找不到 Firebase 数据库中已有的用户名

android - 如何在 flutter 中访问 DocumentReference 数组?