2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2014-10-28 17:29:42 +03:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-06-01 23:30:50 +04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2016-01-19 16:03:27 +03:00
|
|
|
const {
|
|
|
|
canInvoke,
|
|
|
|
inject: {service}
|
|
|
|
} = 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-01-19 16:03:27 +03:00
|
|
|
notifications: service(),
|
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');
|
2014-07-25 17:38:13 +04:00
|
|
|
transition.abort();
|
2014-06-30 16:58:10 +04:00
|
|
|
} else {
|
|
|
|
this.send('invalidateSession');
|
|
|
|
}
|
2014-10-25 01:09:50 +04:00
|
|
|
}
|
2014-06-01 23:30:50 +04:00
|
|
|
});
|