Using Ember, I have a login page where I don't want to display the header or sidebar navigation for my site until the user is authenticated. Once they are logged in, I want the header and sidebar to be visible. Currently, I am achieving this by checking if session.isAuthenticated in application.hbs. If it's true, I show the header and sidebar; if not, I hide them.
While this approach works, I'm facing an issue once I log in and transition to the default authenticated route. The dropdown functionality for the sidebar stops working - clicking on the links does nothing. However, if I navigate to a different route, the dropdowns start functioning as expected. I suspect this is because the sidebar elements are not generated when the page initially loads due to the user not being authenticated.
Is there a more effective way to handle this situation or can I force a reload of the JavaScript?
EDIT: For reference, here is a gist containing the application.hbs and sidebar.js files: