CptToucan / waryes

BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

feat: abstracted menu into its own component using app authentication… #4

Closed izohek closed 2 years ago

izohek commented 2 years ago

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.

izohek commented 2 years ago

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.