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
If the current transition is aborted, this method will save it in the
property so that it can be retried after the session is authenticated
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.
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