0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/client/app/routes/signout.js

24 lines
621 B
JavaScript
Raw Normal View History

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