1

I have Google Flutter mobile up with Firebase functions, OAuth and DB I would like for all new users to only sign up via company emails no Hotmail or Gmail, etc. First, should this be done via Firebase DB rules, functions or should it be done in the mobile app with Google dart on signup?

And if so does anyone have some code examples to share or how to do this?

Almog
  • 2,639
  • 6
  • 30
  • 59

1 Answers1

1

You must enforce the company email in both the app and the DB rules, providing a good experience and also security.

Starting point to understand Firestore security rules:
https://fireship.io/snippets/firestore-rules-recipes/

For the DB rules use match:
https://firebase.google.com/docs/reference/rules/rules.String#matches

And Regex:
How to validate an email address using a regular expression?

Rod
  • 1,601
  • 12
  • 18