mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
ae759d39ea
no issue - disabled Ember Simple Auth's default token revocation - we trigger session invalidation on a 401 which means our token isn't valid so the revoke requests will also fail - renamed application route's `invalidateSession` to `logout` in order to distinguish it from any ESA methods - added the token revocation requests to this action, we can be fairly sure at this point that the current tokens will be valid so the requests will succeed - added check to `ajax.handleResponse` so that we don't invalidate the session for requests to external services - removed pointless assertion from the ajax integration test
25 lines
658 B
JavaScript
25 lines
658 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import Ember from 'ember';
|
|
import styleBody from 'ghost-admin/mixins/style-body';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
// ember-cli-shims doesn't export canInvoke
|
|
const {canInvoke} = Ember;
|
|
|
|
export default AuthenticatedRoute.extend(styleBody, {
|
|
notifications: service(),
|
|
|
|
titleToken: 'Sign Out',
|
|
|
|
classNames: ['ghost-signout'],
|
|
|
|
afterModel(model, transition) {
|
|
this.get('notifications').clearAll();
|
|
if (canInvoke(transition, 'send')) {
|
|
transition.send('logout');
|
|
} else {
|
|
this.send('logout');
|
|
}
|
|
}
|
|
});
|