The Firebase auth system is the source of a users
photoURL, and maybe
.updateProfile method. Storing these values in the Realtime Database, rDB,
users node poses the issue of stale data. Display names, for example, may change. To keep these values in synch use local storage in concert with
db.ref.child('users').updatethe values of
.onAuthStateChange fires on every page load or reload, as well as on every auth state change. It potentially fires often, e.g. multi page apps. However reading and writing to local storage is synchronous and very fast so there will be no noticeable impact on app performance.