ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Lazy load models, routes, controllers AFTER authentication

Open friedhelm-langhof opened this issue 13 years ago • 1 comments

Hello! I searched a lot for finding solutions for my theoretical problem:

I'd like to hide as much as i can to unauthenticated users. This means a perfect solution for me would be to only have the users-/sessions-route/model/controller and load everything else what i need for my application after log in. I found some solutions, but they don't really fit.

a) Provide more than one or a non-ember-log-in: Seems to be okay, for an application where all authenticated see the same (no advanced right system), but this is not an real ember-way because I love write just one app and extend it.

b) Provide all the model data and just restrict the api. Yeah of course, but in real application i'd also like to hide application knowledge for an unprivileged user.

Any ideas? Can this be solved with register & inject? How? Is de-&encryption one way to go?

thx for any input!

friedhelm-langhof avatar May 25 '13 09:05 friedhelm-langhof

There is not great support for asynchronous loading of an application. It is theoretically possible, but I'm sure there would be rough edges that would need updates to Ember to work through. I think you have the right workarounds in mind in your (a) and (b) and to be honest, if I was starting a project now, I would choose one of those workarounds. The benefit of your ideal path seems small for the amount of effort that would likely be required. Going to close this, but feel free to continue the conversation in this thread.

lukemelia avatar May 25 '13 17:05 lukemelia