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
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);
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 was authenticated (see sessionAuthenticated.
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.
The transition that lead to this route