Open esbenvb opened 4 years ago
You need to pass true
to second parameter of firebase.updateAuth()
for it to sync profile data with database
firebase.updateAuth({displayName:'...', profileA: '...', profileB: '...'}, true)
It will call firebase.updateProfile
to do an actual update on your database.
Maybe, you should add it to the documentation?
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I want to update the user profile document in firestore, whenever I update the firebase auth data. For instance, when I update the
displayName
andphotoURL
in of a Firebase.User.Currently, a
firebase.login()
will copy thedisplayName
and map thephotoURL
to theavatarUrl
field ofusers/xxxxxx
However, when I update the Firebase auth profile, either using your
firebase.updateAuth()
or the originalfirebase.auth().currentUser.updateProfile()
, theavatarUrl
andproviderData
fields are not updated, before I logout and in again.What is the expected behavior?
I expect that if I call the
firebase.updateAuth()
helper function in order to update the profile, it will do the same data syncing fromfirebase auth
to theusers/xxx
document, as when I log in.The changes made by the user (i.e. new name or profile picture) needs to be effective before logging out and in.
Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?
I also tested with newest 2.4.1, same issue