In my flutter app I want to create a phone authentication for sign up, with one condition that only those phone numbers, which are already been stored in firestore database can sign up.. ….. How can I access firestore data before signing in?
In my flutter app I want to create a phone authentication for sign up, with one condition that only those phone numbers, which are already been stored in firestore database can sign up.. ….. How can I access firestore data before signing in?
2
Answers
You can create a rule set for firebase access on the firebase application console.
This is a good place to look:
Firestore Security Rules Docs
Register a blocking function for
beforeCreate
event and check that a user’s phoneNumber is in a list of allowed numbers. If not throw an error.See Extend Firebase Authentication with blocking Cloud Functions for details.