mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
25 lines
686 B
JavaScript
25 lines
686 B
JavaScript
import Ember from 'ember';
|
|
import injectService from 'ember-service/inject';
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import styleBody from 'ghost-admin/mixins/style-body';
|
|
|
|
// ember-cli-shims doesn't export canInvoke
|
|
const {canInvoke} = Ember;
|
|
|
|
export default AuthenticatedRoute.extend(styleBody, {
|
|
titleToken: 'Sign Out',
|
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
notifications: injectService(),
|
|
|
|
afterModel(model, transition) {
|
|
this.get('notifications').clearAll();
|
|
if (canInvoke(transition, 'send')) {
|
|
transition.send('invalidateSession');
|
|
} else {
|
|
this.send('invalidateSession');
|
|
}
|
|
}
|
|
});
|