Open
Description
The useAuthState
hook only updates if the user logs in or logs out and not if the user updates in any way. This is a limitation of the underlying onAuthStateChange
method described here: https://firebase.google.com/docs/reference/js/firebase.auth.Auth#onauthstatechanged
Proposal
New useCurrentUser
hook which listens to updates to the user as well as login / logout events
Thoughts
This is likely to need a few things:
- A context provider that sits at the top level of the application and stores the current user
- A series of hooks that wrap each of the
update
methods available in Firebase Auth and updates the user within the context
See #108 for further background.