2014-06-01 15:30:50 -04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-04 23:18:23 -04:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-06-01 15:30:50 -04:00
|
|
|
|
2014-07-25 15:38:13 +02:00
|
|
|
var SignoutRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
2014-06-01 15:30:50 -04:00
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
|
2014-06-30 14:58:10 +02:00
|
|
|
afterModel: function (resolvedModel, transition) {
|
|
|
|
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
|
|
|
this.transitionTo('signin');
|
|
|
|
} else {
|
|
|
|
this.send('invalidateSession');
|
|
|
|
}
|
2014-06-01 15:30:50 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-06-13 13:35:22 -06:00
|
|
|
export default SignoutRoute;
|