Ghost/ghost/admin/app/routes/authenticated.js
Kevin Ansfield cf7a763199 Removed usage of deprecated EmberSimpleAuth mixins (#1910)
refs https://github.com/TryGhost/Admin/pull/1901

Ember has deprecated mixins in preparation for 4.0 and `ember-simple-auth` has now done the same in 3.1.0.

- removed all imports of Ember Simple Auth mixins
- moved authenticated and invalidated handling from application route to session service
- moved server-notification loading from application route to session service
- updated `AuthenticatedRoute` to use the session service directly rather than authenticated route mixin
- added `UnauthenticatedRoute` that incorporates the behaviour from our overridden `UnauthenticatedRouteMixin` and switches to using the session service directly
2021-04-12 13:21:57 +01:00

11 lines
254 B
JavaScript

import Route from '@ember/routing/route';
import {inject as service} from '@ember/service';
export default Route.extend({
session: service(),
beforeModel(transition) {
this.session.requireAuthentication(transition, 'signin');
}
});