1
votes

I'm creating an application with flutter and using firebase for authentication in data storage (possible more).

I have an auth onCreate cloud function which adds some user information to my realtime database whenever a user is created. But, I also want to set a displayName and photoURL when the user is created because if I update the profile info after, the onCreate won't be triggered. I also don't want users to be able to write to this part of the database.

Is there any method I can user to pass an displayName and photoURL when the user is created? Currently, I'm just creating the user with an email and password.

Thanks.

1
There is no way to create an email+password user and give them a display name and photo URL at the same time. It'll require at least two API calls. Stratubas' approach is the most common workaround. Also see stackoverflow.com/q/60405997,Frank van Puffelen

1 Answers

2
votes

Instead of creating the users directly from the client, you can use a callable function to create users using the Admin SDK, which includes displayName and photoURL in its options.