I’m working on a project where some pages have content that requires no authentication to access, but if the user authenticates, extra content is displayed on the same page. Sometimes the extra content is an extra model, in other times it is a collection.
So far, my approach for loading the data in such a route is to utilize Ember.RSVP.hash
. If the user is authenticated, extra data gets loaded by the promise. When there is a transition from an unauthenticated to authenticated state or vice-versa, a route refresh is triggered.
This approach has been working so far, but as I add more pages that require such functionality, I can’t help but think that I may be structuring this in the wrong way. What is the recommended approach for this? Making more routes? What are the recommended approaches for routes that handle a mix of collections and models?