Add Additional Data To User Profile Via Firestore Functions Oncreate
I'm trying to automatically create a user data in my firestore db when user sign up through firestore functions. However I got 2 option for sign up. Bussiness account and personal
Solution 1:
No additional information is passed into the functions.auth.user().onCreate(
function, so there's no way to distinguish between the two types of users there.
The best you can do is set the user-type from within the client by writing the same document from there. To prevent a race condition, you'll want to move the entire creation of the user-document to the client.
Baca Juga
- Firebase Cloud Function Error: Registration Token(s) Provided To Sendtodevice() Must Be A Non-empty String Or A Non-empty Array
- How To Fix "function Returned Undefined, Expected Promise Or Value" When Creating A Function For Firebase?
- How To Query The Existing Children Of A Sibling Node And Loop Over Them To Detect If It Exists?
Post a Comment for "Add Additional Data To User Profile Via Firestore Functions Oncreate"