2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2016-06-30 13:21:47 +03:00
|
|
|
import injectService from 'ember-service/inject';
|
2016-05-24 15:06:59 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
import styleBody from 'ghost-admin/mixins/style-body';
|
2014-06-01 23:30:50 +04:00
|
|
|
|
2016-06-30 13:21:47 +03:00
|
|
|
// ember-cli-shims doesn't export canInvoke
|
|
|
|
const {canInvoke} = Ember;
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2015-05-26 05:10:50 +03:00
|
|
|
export default AuthenticatedRoute.extend(styleBody, {
|
2014-11-25 23:56:08 +03:00
|
|
|
titleToken: 'Sign Out',
|
|
|
|
|
2014-06-01 23:30:50 +04:00
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
|
2016-06-30 13:21:47 +03:00
|
|
|
notifications: injectService(),
|
2015-05-26 05:10:50 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
afterModel(model, transition) {
|
2015-10-07 17:44:23 +03:00
|
|
|
this.get('notifications').clearAll();
|
2015-10-28 14:36:45 +03:00
|
|
|
if (canInvoke(transition, 'send')) {
|
2014-06-30 16:58:10 +04:00
|
|
|
transition.send('invalidateSession');
|
|
|
|
} else {
|
|
|
|
this.send('invalidateSession');
|
|
|
|
}
|
2014-10-25 01:09:50 +04:00
|
|
|
}
|
2014-06-01 23:30:50 +04:00
|
|
|
});
|