Skip to content

Instantly share code, notes, and snippets.

@pavloo
Created June 23, 2014 16:05
Show Gist options
  • Save pavloo/e07d7769b0332fe07f60 to your computer and use it in GitHub Desktop.
Save pavloo/e07d7769b0332fe07f60 to your computer and use it in GitHub Desktop.
Application = Ember.Route.extend
model: (_, transition)->
@_needsAuth(transition.targetName) and @store.find('user', 'current').catch( =>
@transitionTo('sign_in')
Ember.RSVP.resolve()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment