mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
27 lines
635 B
JavaScript
27 lines
635 B
JavaScript
import Ember from 'ember';
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
const {
|
|
canInvoke,
|
|
inject: {service}
|
|
} = Ember;
|
|
|
|
export default AuthenticatedRoute.extend(styleBody, {
|
|
titleToken: 'Sign Out',
|
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
notifications: service(),
|
|
|
|
afterModel(model, transition) {
|
|
this.get('notifications').clearAll();
|
|
if (canInvoke(transition, 'send')) {
|
|
transition.send('invalidateSession');
|
|
transition.abort();
|
|
} else {
|
|
this.send('invalidateSession');
|
|
}
|
|
}
|
|
});
|