Ghost/ghost/admin/app/routes/signout.js

27 lines
635 B
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Ember from 'ember';
import AuthenticatedRoute from 'ghost/routes/authenticated';
import styleBody from 'ghost/mixins/style-body';
2016-01-19 16:03:27 +03:00
const {
canInvoke,
inject: {service}
} = Ember;
export default AuthenticatedRoute.extend(styleBody, {
titleToken: 'Sign Out',
classNames: ['ghost-signout'],
2016-01-19 16:03:27 +03:00
notifications: service(),
afterModel(model, transition) {
this.get('notifications').clearAll();
if (canInvoke(transition, 'send')) {
transition.send('invalidateSession');
transition.abort();
} else {
this.send('invalidateSession');
}
}
});