Here's one approach to an application menu component. The component uses the current Firebase user to determine the menu content. Menu content is further defined by a json object with a provided overridable default configuration.
The <application-route> component has been updated to use Firebase's onAuthStateChange to keep updated on current auth status.
I've tested with Firebase a bit and it seems to be responsive to changes in user state, but it's a bit hard to do a full test without login/logout. I did register though and my cached user is triggering menu changes.
I made a few assumptions in the implementation, like only two auth levels. Might be worth having a higher level discussion on auth setup if we want anything different or more complicated.
Here's one approach to an application menu component. The component uses the current Firebase user to determine the menu content. Menu content is further defined by a json object with a provided overridable default configuration.
The
<application-route>
component has been updated to use Firebase's onAuthStateChange to keep updated on current auth status.I've tested with Firebase a bit and it seems to be responsive to changes in user state, but it's a bit hard to do a full test without login/logout. I did register though and my cached user is triggering menu changes.