As I do this, I pass an authenticated user with my data. and I have an initConfiguration function inside my main application
so inside the index file (in this case I'm showing you jade) I have this:
// initialize ember settings script(type='text/javascript') App.initConfiguration('!{currentUser}')
and inside my application file I have (coffeescript here)
window.App = Ember.Application.create currentUser: null initConfiguration: (currentUser) -> if currentUser? and currentUser.length > 0 @set 'currentUser', currentUser
If you are using ember data, you need to change the application file to
window.App = Ember.Application.create currentUser: null tempCurrentUser: null initConfiguration: (currentUser) ->
and then inside your application route do the following
App.ApplicationRoute = Ember.Route.extend setupController: (controller) -> if App.tempCurrentUser? App.setCurrentUser(App.tempCurrentUser)
source share