Search code examples
ember-simple-auth

Is it possible to make all routes authenticated with Ember Simple Auth?


Ember Simple Auth provides a route mixin that lets you authenticate certain routes in your application.

I'm working an app where essentially every route (except the login route) is authenticated. Is is possible to specify this in a single option somewhere, instead of having to include the mixin in each route?


Solution

  • No, that's not possible. The best solution is to add an internal route and move all routes (except the login and index routes) under that route. From the index route's beforeModel you could transition to the internal route when the session is already authenticated.