import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

This mixin is used to make routes accessible only if the session is authenticated. It defines a beforeModel method that aborts the current transition and instead transitions to the authenticationRoute if the session is not authenticated.

// app/routes/protected.js
          import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
          export default Ember.Route.extend(AuthenticatedRouteMixin);


source public


Checks whether the session is authenticated and if it is not aborts the current transition and instead transitions to the authenticationRoute. If the current transition is aborted, this method will save it in the session service's attemptedTransition property so that it can be retried after the session is authenticated (see sessionAuthenticated). If the transition is aborted in Fastboot mode, the transition's target URL will be saved in a ember_simple_auth-redirectTarget cookie for use by the browser after authentication is complete.

If beforeModel is overridden in a route that uses this mixin, the route's implementation must call this._super(...arguments) so that the mixin's beforeModel method is actually executed.


transition: Transition

The transition that lead to this route


source public

authenticationRoute: String

Default: 'login'

The route to transition to for authentication. The AuthenticatedRouteMixin will transition to this route when a route that implements the mixin is accessed when the route is not authenticated.

source public readonly

session: SessionService

The session service.