Skip to content

Instantly share code, notes, and snippets.

@marcoow
Last active December 20, 2015 19:39
Show Gist options
  • Save marcoow/6184695 to your computer and use it in GitHub Desktop.
Save marcoow/6184695 to your computer and use it in GitHub Desktop.
App.AuthenticatedRoute = Ember.Route.extend({
redirectToLogin: function(transition) {
App.Session.set('attemptedTransition', transition);
this.transitionTo('session.new');
},
beforeModel: function(transition) {
if (!App.Session.get('authToken')) {
this.redirectToLogin(transition);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment