2015-02-12 21:22:32 -07:00
|
|
|
import Ember from 'ember';
|
2014-10-28 08:29:42 -06:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-06-01 15:30:50 -04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2015-05-25 21:10:50 -05:00
|
|
|
export default AuthenticatedRoute.extend(styleBody, {
|
2014-11-25 12:56:08 -08:00
|
|
|
titleToken: 'Sign Out',
|
|
|
|
|
2014-06-01 15:30:50 -04:00
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
|
2015-05-25 21:10:50 -05:00
|
|
|
notifications: Ember.inject.service(),
|
|
|
|
|
2014-07-29 20:49:26 +00:00
|
|
|
afterModel: function (model, transition) {
|
2015-05-25 21:10:50 -05:00
|
|
|
this.get('notifications').closeAll();
|
2014-06-30 14:58:10 +02:00
|
|
|
if (Ember.canInvoke(transition, 'send')) {
|
|
|
|
transition.send('invalidateSession');
|
2014-07-25 15:38:13 +02:00
|
|
|
transition.abort();
|
2014-06-30 14:58:10 +02:00
|
|
|
} else {
|
|
|
|
this.send('invalidateSession');
|
|
|
|
}
|
2014-10-24 21:09:50 +00:00
|
|
|
}
|
2014-06-01 15:30:50 -04:00
|
|
|
});
|