Working on my first EmberJS app. The entire app requires that a user be logged in. I\'m trying to wrap my head around the best way to enforce that a user is logged in now (when
If you need to perform a check before initial state transition, there is a special function on the Ember.Application
class called deferReadiness()
. The comment from the source code:
By default, the router will begin trying to translate the current URL into application state once the browser emits the
DOMContentReady
event. If you need to defer routing, you can call the application'sdeferReadiness()
method. Once routing can begin, call theadvanceReadiness()
method.
Note that at the time of writing this function is available only in ember-latest